Getting Started with IOIO (Part 1)

*Note: This tutorial will cover on IOIO V1.

INTRODUCTION
The IOIO (pronounced “yo-yo”) is a board that provides a host machine the capability of interfacing with external hardware over a variety of commonly used protocols. The original IOIO board has been specifically designed to work with Android devices. The IOIO board can be connected to its host over USB or Bluetooth, and provides a high-level Java API on the host side for using its I/O functions as if they were an integral part of the client. In short, IOIO is like an extended I/O pins for your Android phone and you are not required to do any sort of embedded programming. Honestly, this board is very advantage for those who have knowledge in Java + Eclipse + Android. But don’t worry, this tutorial will guide you to setup the software and only go over writing a simple Java app using the IOIO library. There is another tutorial here: Getting Started with IOIO (part 2), using Bluetooth Dongle to create Bluetooth link with Android phone and perform a simple test.

IOIO HARDWARE

In general, IOIO board contains the following components (for more detail, you can click on the image):
1. Type A female USB connector – Used to connect to the Android device.
2. GND pins – Ground connection.
3. VIN pins – Used for power supply to the board. Voltage between 5V-15V should be supplied.
4. 5V pins – Normally used as 5V output when the board is powered from VIN. Can be used as 5V input in case VIN is not connected.
5. 3.3V pins – 3.3V output.
6. I/O pins – General purpose I/O pins. Some have special functions.
7. power LED – Lights when the IOIO is getting power.
8. stat LED – Lights briefly during power-up and then becomes under application control.
9. mclr pin – Not normally used. Its purpose is for programming new bootloader firmware on the IOIO board.
10. Charge current trimmer (CHG) – Adjusts the amount of charge current supplied on the VBUS line of the USB to the Android device. Turning in the (+) direction increases charge current.

HARDWARE PREPARATION
1. Android device with OS 2.0 or greater (latest OS is better).
2. IOIO board with latest support firmware (bootloader).
3. USB cable that is support with your Android device.
4. 5-15V power supply.

IOIO Hardware Preparation

SOFTWARE SETUP
There have 3 important software that you need to install:
1. Java Development Kit (JDK).
2. Eclipse IDE.
3. Android SDK.
You can download JDK here. For Eclipse IDE and Android SDK, you can download a bundle here, which include these 2 software. You can choose either 32-bit or 64-bit. In my case, I choose 32-bit even my laptop running Windows OS with 64-bit.

Install the JDK and restart the PC if needed. Unzip your ADT bundle, then open the Eclipse IDE (adt-bundle-windows-x86-XXXXXXXX > eclipse > eclipse.exe). If fail, most propably your software cannot detect the JDK. So my advice, make sure this work first before going further.

Then you need to install the SDK components relevant to the Android device you will be working with (adt-bundle-windows-x86-XXXXXXXX > SDK Manager.exe).

SDK

IOIO LIBRARIES
Before start with Android programming, you need to download the IOIO libraries here. Go to “Client Software and IOIO Application Firmware Images”, download libraries version which suite with your IOIO bootloader version. For example, I’m using IOIO libraries 330 “App-IOIO0330.zip” and IOIO bootloader 3.11 + App V4.00 “Boot-IOIO0311-App-IOIO0400.zip”. Unzip the downloaded package into a safe location where you want to keep your project files.

Next, open Eclipse, go to File > Import, and select Existing Android Code Into Workspace. Click Next.

Eclipse Import

Click Browse and navigate to the file you just unzipped and point to the HelloIOIO folder found in …/applications/HelloIOIO. Be sure the check box under Project to Import is selected. Now hit Finish.

Eclipse Import

Now, you should see HelloIOIO under your Package Explorer. If you notice, there have an error on the MainActivity.java because it can’t find the ioio.lib. So you need to import the IOIO library by repeating the method above but navigate/point to the library folder.

Eclipse Import 3

After finish import all the library given, it should be no error.

Eclipse Import 4

If there still have an error, go to HelloIOIO (right click) > Properties > Android. Add corresponding library.

Eclipse Import 5

Now, it is time to build the code and run into your Android phone. You can set the target selection mode. Go to HelloIOIO (right click) > Run As > Run Configurations… Select Android Application and press New.

Android Run

Under Android tab, write Android Applcation Name and browse to your project. Click Apply.

Android Run 2

Under Target tab, tick on Always prompt to pick Device. Then, hit Apply and Run.

Android Run 3

Make sure your phone is connected to the PC and have been identified (enable USB Debugging). Select on the device and click OK. In this example, I’m using Nexus 4 with Android OS 4.4.2.

Android Run 4

If successful, the apps will automatic run in your phone. This is a screenshot from my phone.

Hello IOIO

Lets connect to the IOIO board and see the result. You can connect either using USB cable or bluetooth dongle.

Hello IOIO USBHello IOIO Bluetooth
Ok, that’s all. If you have any problem/suggestion, please leave a comment. Good Luck! 🙂

References:
https://www.sparkfun.com/tutorials/280
https://github.com/ytai/ioio/wiki
https://github.com/ytai/ioio/wiki/IOIO-Developer-Getting-Started-Guide

Hello IOIO video:
[youtube]http://www.youtube.com/watch?v=tkW9MJ1jDCI[/youtube]

IOIO application (IOIO Camera Robot) video:

6 thoughts on “Getting Started with IOIO (Part 1)

  1. I’m using App-IOIO0503 which has IOIOLibAndroidDevice. do i need to import this file into eclipse as well?

  2. Thank you so much for the valuable instructions.
    Actually I’ve followed them and the app gets installed on my Samsung Galaxy S5 sucessfully. But I’m having problems turning the LED on the IOIO OTG board. I connected the phone to the board through a Usb cable. But the Led doesnt turn ON when I press the ON/OFF button on the phone.

    I’d be very thankful if you could leave a comment. Thank you!

  3. Hi Luciano, I recommended you to use bluetooth dongle instead of USB cable. I also sometimes face the same problem when using USB cable with different phone. I have write another tutorial “Getting Started with IOIO Part 2” (http://tutorial.cytron.com.my/2014/09/05/getting-started-with-ioio-part-2/), and I think this one is much more easier to test our IOIO board.

    If you have more questions, please post on Cytron technical forum (http://forum.cytron.com.my/). Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *