The Formula AllCode, recently launched by Matrix TSL, is designed with a complete API allowing it to be controlled from many programming languages via it’s Bluetooth interface. Flowcode is no exception and can work with the Formula AllCode in two distinct ways.
- We use the Formula AllCode component and this allows us to change the firmware loaded onto the microcontroller on-board the AllCode. This gives you the option to control the robot in autonomous modes using the power of the 70MIPs 16-bit dsPIC microcontroller. The firmware can be altered using either the USB or Bluetooth data connections.
- We use the Formula AllCode API component and this uses the serial communications functionality built into Formula AllCode DLL. This gives you the option to control the robot in slave mode with your PC at the controls therefore giving you much wider scope for advanced mathematic operations or creating a bridge to the internet allowing you to control the robot from half way round the world if you so wish.
Let’s quickly explore both of these techniques.
The Formula AllCode Component:
This component features a fully operational simulation allowing you to test out your control routines using Flowcode primitive objects to create lines to follow, mazes to solve, we can even do a find the light type routine with an object being used as the light source.
In the Components Tools menu there is a racetrack and a maze generator allowing you to quickly generate a scenario for the robot.
As we are sending the firmware to the microcontroller on the Formula AllCode we can even use the AllCode to teach embedded skills ranging from simple primary type fixed movements to solve a maze or do a dance through to post graduate control algorithms such as PID, Fuzzy Logic or Behavioural Control.
Some other goodies that come out the box with the Formula AllCode component simulation is the ability to view the sensor readings as they are sampled. The console window provides the central place for the readings to be displayed.
The Formula AllCode API Component:
The API component allows us to control a Formula AllCode robot from within the Flowcode simulation. Here we control the value on the LEDs by reading a value from a simulated analogue slide potentiometer. The console now provides a list of the API function calls, the parameters and the return values.
The selected communications port is automatically opened when you start the simulation. The motors speed are automatically set to 0 before closing the port when you end the simulation.
The next example reads the front IR range sensor. If an object is detected in front of the sensor then Flowcode will use its speech synthesis to output the word Hello to greet any passers-by.
Finally we have an example to drive the Formula AllCode robot around using a keypad inside the Flowcode simulation. The different keys on the keypad allow us to specify the movement of the robot. This would be useful for sending the robot into areas where it might be unsafe for humans. Strap on a wireless web camera and you have a handy bomb disposal bot.
Flowcode and API Examples
6,970 total views, 2 views today