Android + IOIO + Simple Digital Output
Simplest possible digital output with Android and IOIO. This article will discuss the bare minimal requirements for development of an Android USB (or Bluetooth) digital output device. The goal is to demonstrate the easiest possible use of the technology. For additional background information on Android development, IOIO, and electronics, check out these links:
Meet IOIO
IOIO for Android Beginners Guide
IOIO Wiki
Android Developer’s Guide
Hardware
Parts needed:
- Android Device (1.6+, 2.1 for Bluetooth)
- IOIO (available at Sparkfun)
- 3x LED Lights
- 3x 330 ohms resistors
- Breadboard
- Power supply
- Hook-up wire
Assembly
Connect the 330 ohm resistors in series with the anodes of the LEDs to the desired digital output pins, and the cathodes of the LEDs to ground. The example uses digital pins 34, 35, and 36, but can be used with any IO pin (all IOIO pins are GPIO pins). The resistors, in this case, are being used to prevent current overdraw to the LEDs. Here is a diagram of the completed circuit (created with Fritzing):
Software
Get the source
With the circuit assembled, the next step is to get the demo application on the Android device. You can either download the pre-built .apk or checkout the source from Github:
git clone git://github.com/mitchtech/android_ioio_simple_digital_output.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.









Thanks a lot for this.
Have you tried having the button send a single impulse response?
Which library file need to import from the list of ioio library project?
The file you need is IOIOLib (and optionally IOIOLibBT, for Bluetooth support). Here is a detailed walkthough from Sparkfun on how to import them into Eclipse: http://www.sparkfun.com/tutorials/280
Hi Michael, how the application works in the background.
You should use android service.
There is a good example of how to use the IOIO service in Ytai’s main IOIO repo on Github here
You’ve got the best IOIO examples on the net! Very well done!
sorry could i ask , why i cannot compile the code …got 29 error ….may i know what problem ? …my eclipse is the latest version .
http://img841.imageshack.us/img841/9634/errorfe.png
the pic …hope u can help me solve the problem
thank …i solve the problem…thank for sharing the example
u are the good person
how did u slove your problem? Could u explain please for the other people? =) Thank you…
hello, are my first programs IOIO OTG, and I have a fatal error AbstractIOIOActivity extiends where I get this error (The AbstractIOIOActivity is deprecated) I can not compile … as I can correct?