Ways to control the T-Bot
- Android - T-Bot Controller - with automatic reconnection (requires the latest T-Bot.ino)
- Android - Joystick bluetooth Commander (Requires TBot_B.ino - might be the better option for slowere devices).
- Python - Using T-Bot Joystick for PC included in the downloaded software
- Writing your own Apps
The simplest way to control your T-Bot is the use the T-Bot Controller.
Connect your android device to you T-Bot
Close Joystick bluetooth Commander and pair your Android device with your T-Bot
Open the T-Bot Controller, switch on your T-Bot and press connect. Select your T-Bot from the list. Once connected, the controller will monitor the connection and automatically reconnect if the connection is lost.
Adjusting the Trim Initially, the most important thing you will have to change on your T-Bot is the trim. You can can use the - and + buttons next to the Trim button in the app to adjust this. You will see the third value in blue change slowly. If your T-Bot is rushing forward, press - repeatedly until the drift is removed. Likewise, if your T-Bot is rushing backwards press + repeatedly until the drift is removed. Once you're happy, you can hard code the trim value into the TBot.ino file. Look for the following lines and set gtrim to the value showing in the Trim datafield (3.0 in the example above). You can now upload the T-Bot.ino code to the T-Bot to make the change persistent.
//////////////////// Speed and Stability tunings ///////////////////////// float gtrim = -1.25; // Compensated for drift in forward or reverse direction. float rtrim = -0.0; // Compensated for rotational drift.
Controlling the T-Bot using Python
There are two versions of the Python controller bundled with your T-Bot software. These have been tested on Linux. You might have do do some googling to get them working on Windows or Mac computers. One uses Pybluez to handel the Bluetooth connection and was written for Python 2 users, the other was written for Python 3 users and uses Socket to handel the Bluetooth connection. Windows users shoul look at PySerial.
You can allow the software to search for your T-Bot or if you know the mac address, you can hard code it in to the software to speed up the connection process.
search = False
bd_addr = '98:D3:32:11:4C:CF' # put the bluetooth address of your T-Bot here.
Then launch a command terminal type the following to launch the Joystick:
The socket version does not have the search function so you need to know the mac address. This can be stored as a python dictionary in the MAC_Adresses file. Multiple address can be stored if you have more than one T-Bot