** Please check on IOIO Inventor’s package name. If you has downloaded on “com.inex.ioioappinventorinter” package name, please change from
- “com.inex.ioioappinventor” to “com.inex.ioioappinventorinter”
- “com.inex.ioioappinventor.IOIOCommand” to “com.inex.ioioappinventorinter.IOIOCommand”
For command on using the IOIO Inventor application are divided into 5 types as follows.
• Digital Command
• Analog Command
• Sound Command
• Motor Command
• Servo Command
The pin of the IOIO board will have different properties according to the table.
Therefore, the user must ensure that pin is support with that command or not.
Command to read digital signal from IOIO board‘s pin. Having two values (True or False)
Pin: A pin of the IOIO board to be used for read digital signal, configurable from 1 to 49
For example, the command to read digital signal from pin 36
Command to set digital signal to IOIO board’s pin. Having two values (True or False)
Pin: A pin of the IOIO board to be used for set digital signal, configurable from 1 to 49 State: a state of pin that needs to set to True or False .
For example, the command to set digital signal to pin 0 to False
For example, the command to set digital signal to pin 0 to True
Command to read analog signal from IOIO board’s pin. Having values from 0 to 1023 (0 = 0V, 1023 = 3.3V)
Pin: A pin of the IOIO board to be used for read analog signal, configurable from 31 to 46
For example, the command to read analog signal from pin 34
Command to set analog signal to IOIO board’s pin. Having values from 0 to 100 (0 = 0V, 100 = 3.3V)
Pin: A pin of the IOIO board to be used for set analog signal, configurable from 0, 2-7, 9-14, 27-32 and 34-40
Percent: a percent of analog signal to be determined (If percent is 50 that means 50% of 3.3V)
For example, the command to set analog signal to pin 4 by 30% (3.3 x 30 / 100 = 0.99V)
Command to generate sound on piezo speaker by piezo speaker must be connected to IOIO board’s pin. The user can configure the frequency and duration of sound.
Pin: A pin of the IOIO board to be used for generate sound, configurable from 2-7, 9-14, 27-32 and 34-40
Frequency: Frequency of sound that will be generated. (Hz)
Duation: Duration of sound that will be generated. (Millisecond)
For example, the command to generate sound to pin 27 by 800 Hz for 500 milliseconds.
Motor command is a command to be used for IOIO-Robotic Activity board which have 6-channels motor controller by fixing pin position which connected to the motor driver module. In order to be connected to the motor driver board which is not IOIO-Robotic Activity board, you must be connected to the IOIO board as follows.
For MotorForward, MotorBackward, MotorLeft, MotorRight and AO command are command for motor channel 1, 2, 5 and 6 (Movement Motors) because these are command to drive motor for use with 2-wheel or 4-wheel drive robot. The user can use motor on channel 3 and 4 for use otherwise.
Command to drive 4 movement motors for forward movement.
Command to drive 4 movement motors for backward movement.
Speed: Speed of motor, configurable from 0 to 100
For example, the command to move backward with 60% movement speed
Command to drive 4 movement motors for turn left movement.
Command to drive 4 movement motors for turn right movement.
Command to stop 4 movement motors.
For example, the command to stop.
Command to control motor by each motor.
Number: Channel number of motor that user want to control Speed: Speed of motor, configurable from -100 to 100 . For example, the command to drive motor channel 1 to move forward with 50% movement speed
For example, the command to drive motor channel 6 to move backward with 70% movement speed
Command to stop motor by each motor.
Number: Channel number of motor that user want to stop
For example, the command to stop motor channel 3
Command to stop all of 6 channel motors.
Command to control servo motor. Define angle of servo motor axis in degree unit.
Pin: A pin of the IOIO board to be used to control servo motor Angle: Angle of servo motor axis in degree unit, configurable from 0 to 180 degree .
For example, the command to move servo motor axis to 90 degree (Middle), by servo motor is connects on pin 48.
Receive data from IOIO Inventor
Sometimes the user likes to get some data from IOIO board such as DigitalRead and AnalogRead command. Which both command are get data the same. This is normally Activity Starter block for IOIO Inventor.
To get data, we will receive data from Activity Starter on “when ActivityStarter AfterActivity” (Depending on Activity Starter name) block.
And data will be return in “Result Type” block. Then choose ActivityStarter1 (Depending on Activity Starter name) block and drag “ResultType” block to workspace.
For example, I defined the variable which name is “variable” and initial value to 0. When I call ActivityStarter1 to read some data, “when ActivityStarter1 AfterActivity” will work and send data that I need. I stored that data on my variable.
This is example program to read digital signal from pin 1. The code is as follows.
Don’t use command to read many data likes this. It won’t work.
In this example, I want to read digital signal from pin 1 and read analog signal from pin 31 by press button to read. I would have created two activities and two procedures with difference command. But I call them in the same time, but It make a problem when data returned, because application can’t recognized the data returned. So I had to read first data then read next data after first data was received as follows.
IOIO Inventor instructions
- The user can open the IOIO Inventor from application which built from App Inventor directly. But I recommend user to open the IOIO Inventor before using.
- Any command for the IOIO Inventor will take 100-200 milliseconds to execute.
- Close the IOIO Inventor by touch application message on notification bar.
- Any problem on connection, close the IOIO Inventor. Then open it again. If connecting via Bluetooth, restart Bluetooth too.