Press on the image to return to the main documentation page.
IOIO
Written by Andrew Graham, inheried by Kolbe
This library contains a driver for the IOIO for Android board distributed by Sparkfun electronics The IOIO (pronounced "yo-yo") is a board specially designed to work with Android devices (OS versions 1.5 and greater). The board provides extensive and robust connectivity to an Android device via a USB connection or Bluetooth and is fully controllable from within a Basic4android application.
This library wraps the IOIOlib java library that Ytai provides.
CRITICAL: If you are new to the IOIO it is critical that you study Ytai's github page for detailed information on the board. It will be hard to understand this library if you haven't understood Ytai's page on the IOIO.
The library should work with both v1 and v2 of the IOIO.
This IOIO object contains the interface to an IOIO board connected by USB or Bluetooth. This interface provides control over all the IOIO board functions.
Previous versions of the library, v1.7 and below, ran on the same thread as your b4a application. Starting with this v1.8, most of the library runs on a separate thread. This has caused to library to change significantly. Be sure to take a look at the IOIO Workbench application and documentation that is included with this library to see how the implementation has changed.
An instance of this interface is obtained by using the Connect method. The Connect method takes care of all the details needed to connect to the IOIO. With the Connect method you can also connect to multiple IOIOs simultaneously.
Most methods now return an event once it has completed on its own thread. This event returns various types of data including all exceptions encountered. Sometimes these events are made optional to facilitate writing code in B4A. This however means that if you decide to not include an event you will not see any exceptions thrown. Be sure to carefully look at each methods documentation to see how the event is named and what data is returned.
Initially all pins are tri-stated (floating), and all functions are disabled. Whenever a connection is lost or dropped, the board will immediately return to the this initial state.
In the Basic4android IDE Library tab, ensure IOIO is selected. Once checked the library version will be displayed.