Introduction

Scripting Engine

The IOIOScript app contains a scripting engine which allows anyone with a bit of JavaScript knowledge to easily harness the power of modern Android phones and tablets for use in their IOIO projects.

Users of the application are not however limited to controlling the IOIO board alone as the scripting engine provides functions to control Lego Mindstorms NXT robot platform too... in fact you can write many other types of Android program since this is the same engine used to write the commercial Android apps published by SmartphoneRemote.com.

You can control the Accelerometer, Compass, Light meter, Wifi, Bluetooth, Camera, SD Card and more. SmartphoneRemote.com also provides a free JavaScript engine for your Windows PC which allows you to write GUI applications in JavaScript which communicate with your IOIOScript programs over Wifi.

Launcher Buttons

When you first start the app, you will see a series of buttons used to run your JavaScript programs. There will initially be some example programs here for you try, but the idea is that you replace these with your own programs. These buttons are generated by the IOIOScript application every time it starts up and scans the /sdcard/IOIOScript folder on your phone for files ending with .js. After you have finished with a program, press the phone's Back Button to return to the launcher screen.

Editing Scripts

You can create and edit programs right here on your phone or tablet using the built-in script editor by long pressing on the Launcher Button. You can also edit them on a PC via USB cable using Windows Notepad, or better still one of the free syntax highlighting text editors such as Notepad++.

Samples

IOIOScript comes with many sample scripts, ranging from very simple "Hello World" type programs which show a single button to more complex ones which involve IOIO, Wifi and Phone-PC communication. It's a good idea to copy the script in one of these samples as a starting point for your own programs. Try to find the one which best matches your requirements.

Measurements

In order to maintain the scale of graphical objects in devices with different screen resolutions all positioning and sizing values are given as a decimal fraction of the screen width or height. For example creating a button with a width of 0.5 would make the button half the screen width and using a height of 0.1 would make the button one tenth of screen height.

Getting Started

Before starting to write your own programs it's a good idea to read the documentation explaining 'Layouts' as these are a fundamental part of every IOIOScript program.