Android + IOIO + Combination Lock
For additional background information on interfacing Android with IOIO, check out my other introductory tutorials:
Background on Android development, IOIO, and electronics:
- Android Device (1.6+, 2.1 for Bluetooth)
- IOIO (available at Sparkfun)
- Hobby servo
- 10k ohm resistors
- Power supply
- Hook-up wire
Connect the red, power line of the servo to +5v, the black ground line to GND, and the yellow signal lines to the desired output pin, number 6 in the example below. Other pins can be used as long as they support peripheral output (for PWM, marked with the letter ‘p’ on the back of the IOIO) AND are 5V tolerant (marked with a black circle around the pin). This leaves pins 3-7, and 10-14 as the only potentials. Also, connect the same signal lines to +5V, with a 10k ohm resistor in series. This allows use of the pins in 5V open drain mode, required since the IOIO operates with 3.3V. Here is a diagram of the completed circuit (created with Fritzing):
Get the source
git clone git://github.com/mitchtech/android_ioio_combination_lock.git
If you are building from source, you will also need to import the IOIO Library project, and optionally the IOIO Bluetooth library projects, both available here:
git clone git://github.com/ytai/ioio.git
Install, connect, profit!
Finally, upload the app to the Android device (or browse to this page on the device and download the apk above). Connect the device to the IOIO, and start up the app.