The open source group in our college hosted a 24 hour hackathon last week called Ayana 2012. We'd heard that they were allowing hardware hacks too, we were totally excited about it and decided to check it out!
Now again, we just couldn't figure how to send sensor data directly from the phone to the computer we were using. Until Shyam found out that we could use a bluetooth module on the arduino to receive sensor data from the phone using The Amarino App on Android. The arduino, once receiving, can send some serial message back to the computer and that in turn generates a keyboard event.
So the next part we thought was pretty simple.
- Read sensor values.
- Setup a threshold to send a serial message.
- Convert serial message into a keyboard event.
And after that part was kinda down, we needed to create keyboard events. Again, not so simple. But after Google searching for several hours looking at Java libraries and all that, we came across:
Serial2Keyboard

All we had to do was change the hex values in the protocol.txt file to ASCII values and we were good to go!
Serial.println('a');
would make the cursor go up, up, up! It was awesome.
But the reason I keep saying it was buggy because when we tried it on a game, we'd go left, and then we'd go right and then, yeah, we'd be stuck there. It just wouldn't go the other way. But it worked fine on notepad! DAMN.
Pissing off, man. |
Anyway, I went and bought a bulb from somewhere and thought we could use it to demonstrate how we can turn on and off appliances using the phone. We got it working after a while, using the proximity sensor on the phone.
It would just toggle on and off though, we couldn't get it to stay on or off.
It would just toggle on and off though, we couldn't get it to stay on or off.
We'll post the code once we fix that.
We also wrote a little python code that let us turn on and off the bulb using twitter! :D The time delay was terrible though, I'll write another post about it soon, as I have a lot more to say about it.
Overall, Ayana12 was a terrific experience. The atmosphere was humming with creativity and laptop fans. I managed to click a few pics too!
Shreya, Surabhi, and Aditi. Trying to look cool. |
They had BEAN BAGS!!!! |
Shyam hooking up the bluetooth module to the Arduino. |
Anjana and her team, Vivek and Kiran. |
Vincent. Showing off. He single-handedly won the whole thing later anyway. :P |
Our station. |
This guy had wireless-ly interfaced a 3x3 array of LCD screens and was playing Die Hard 4 on them. It looked awesome! |
-Bhargav