In the article "Build a Low-Cost Smartphone Based Robot Tank Using the EMGRobotics... I wrote about building a low cost smartphone controlled robot tank for less than $50.00. In this article I am going to cover programming the tank using a free BASIC programming language for Android called RFO Basic.
After following the step-by-step instruction in the "Build a Low-Cost Smartphone Based Robot Tank Using the EMGRobotics... article covering the actual construction of the tank and replacement of the electronics with the EMGRobotics ADMCB board from www.emgrobotics.com. you will need to install the RFO BASIC application on your Android device. The official RFO release can only generate low frequency tones (less than 2000hz). To generate the higher frequency tones required by the ADMCB board/robot I modified the open source RFO project and created my own APK. The only difference between my RFO BASIC release and the official release concerns changes in the tone command.
You can download the modified RFO BASIC here: Basic.apk
After downloading and installing RFO BASIC execute the application by clicking on the icon:
Use the editor to write your code, then select "save" from the menu to save your code in your phone. Be sure the volume is turned all the way up, plug the ADMCB into your Android's headphone jack and select "run" from the menu.
The key to using RFO BASIC with the ADMCB board is the RFO BASIC "tone" command. The tone command is used to generate sound in the frequency range of 1000hz to 10000hz required by the ADMCB board. The table below shows the ADMCB actions associated with each frequency.
tone <frequency> <duration in ms>
To make the robot go forward for 5 seconds use the following command:
tone 8500, 5000
5000ms is 5 seconds. You can replace the numbers with RFO BASIC variables making the possibilities endless. You can learn more about other commands and features in RFO BASIC here: http://laughton.com/basic/
You can learn more about the EMGRobotics ADMCB board here: