Executing Instructions for the Scribbler 2 Robots
The circuitry and firmware for the Scribbler 2 Robots can interpret
about 30 basic commands, such as
- start motors, with designated speeds for the left and right
wheels
- stop both robot motors
- beep a given pitch for a given duration
- retrieve data from specified sensors
- retrieve an image from the robot's camera
- etc.
Although details of the instructions vary, most utilize a 9-byte
format:
- Byte 0: a code designating the operation to be executed
- Bytes 1-??: data needed for the command
- Bytes ??-8: unused
Examples:
- generate a tone at a given pitch for a given duration:
- byte 0: 113
- bytes 1-2: pitch duration in milliseconds
- bytes 3-4: pitch frequency in cycles/second
- bytes 5-8: unused
- turn the robot at specified speeds for the left and right
wheels
- byte 0: 109
- byte 1: left wheel power (0-99: backward; 100 stop; 101-200 forward)
- byte 2: left wheel power (0-99: backward; 100 stop; 101-200 forward)
- byte 3: -1
- bytes 4-8: unused
A full list of Scribbler 2 robot instructions, including instruction
formats, may be found at
https://walker.cs.grinnell.edu/bluetooth-with-c/scribbler-commands.shtml
created 25 January 2021
last revised 26 January 2021
|
|
|
previous next
|