All received commands will be converted into uppercase before processing, so command processor becomes case insensitive. Whitespace is optional where other seperators and delimiters already exist. Where one space can exist, multiple spaces will also be accepted. All commands shall be terminated by a "\n" character (ASCII 10).
All commands will return either "OK\n
", "ERROR\n
" or "TIMEOUT\n
" as their final status, and no further user input will be read until then.
Upon reset, the current firmware version and EEPROM settings will be displayed. Typing "?\n
" at the beginning of a line will display a command summary.
SV[n] [+|-]m [[+|-]m ...]\n
Hobby servo command. n
is the number of a specific
servo, and can range from 0 to 7 inclusive. m
from 0 to 255 inclusive. Maximum of 8 servo movement parameters. A +
or -
prefix will cause m
to be interpreted as a relative increment or decrement from the servo's current position. Position 0 disables the particular servo, position 128 being the servo's center position. At startup, all servos are disabled.
Returns: | ||
OK\n | Commmand completed | |
ERROR\n | Error parsing command |
SV5 30\n
SV0 +10\n
SV7 -67\n
SV 5 +4 -12\n
SV 0 0 0 0 +15 -27 +2 50\n
MT[n] [+|-]m [[+|-]m]\n
DC motor control. n
is the number of a DC motor (0 or 1). m
is PWM duty-cycle, 0 being off, 255 begin 100%. The + or - prefix controls the direction of the motor, defaults to + if unspecified.
Returns: | ||
OK\n | Command completed | |
ERROR\n | Error parsing command |
MT1 100\n
MT 250 -50\n
DBn [d ...]\n
Daughterboard command. n
is the number of a specific daughterboard, valid values from 0 to 7 inclusive. d
is a data byte that is to be sent to the daughterboard, in decimal form, 0 to 255 inclusive. Response packet will only be read from daughterboard if data bytes are sent.
Returns: | ||
<daughterboard response>\nOK\n | Command completed | |
NACK\n | NACK received during I2C transmission | |
ERROR\n | Error parsing command |
DB3 15 27 230 0\n
DB0\n
SS "foo" [Rn]\n
Sends command to the camera, using the secondary serial port. The R option specifies the number of "\n
" delimited lines to echo from camera output, n
can range from 1 to 255 inclusive. Camera output is echoed completely, including the "\n
" character. No camera output is echoed if no R option is present. There is a timeout value between receiving consecutive bytes from the camera.
Returns: | ||
OK\n | Read from camera output completed | |
TIMEOUT\n | Timeout while waiting for camera output | |
ERROR\n | Error parsing command |
SS "foo"
SS"b a r"R4
SSR1
ANn\n
Read from analog input port. n
is the number of the analog input, valid values from 0 to 7 inclusive.
Returns: | ||
<0..255>\nOK\n | Digitized analog value | |
ERROR\n | Error parsing command |
DIn\n
Read from digital input port. n
is the number of the digital input, valid values from 0 to 7 inclusive. Will configure the specified I/O pin as an input if it is not already so.
Returns: | ||
0\nOK\n | Binary logic value | |
1\nOK\n | Binary logic value | |
ERROR\n | Error parsing command |
DHn\n
Output high from digital output port. n
is the number of the digital input, valid values from 0 to 7 inclusive. Will configure the specified I/O pin as an output if it is not already so.
Returns: | ||
OK\n | Command completed | |
ERROR\n | Error parsing command |
DLn\n
Output low from digital output port. n
is the number of the digital input, valid values from 0 to 7 inclusive. Will configure the specified I/O pin as an output if it is not already so.
Returns: | ||
OK\n | Command completed | |
ERROR\n | Error parsing command |
TO[n]\n
Set or show camera output timeout, being the maximum idle time between 2 consecutive bytes of camera output. n
is the timeout value in 10s of milliseconds, ranging from 0 to 255 inclusive, and takes effect immediately. It will be stored into EEPROM and still be in effect after a reset. A value of 0 would indicate an infinite timeout. If n
is not specified, returns the current timeout value.
Returns: | ||
OK\n | Command completed, timeout value set | |
[0..255]\nOK\n | Current timeout value, in ms. | |
ERROR\n | Error parsing command |
BR<9600|19200|38400|115200>\n
Sets baud rate of serial communications port. New baud rate will be stored into EEPROM and will only take effect after a reset.
Returns: | ||
OK\n | Command completed | |
ERROR\n | Error parsing command |
BRS<9600|19200>\n
Sets baud rate of secondary serial port. New baud rate will be stored into EEPROM and will take effect immediately.
Returns: | ||
OK\n | Command completed | |
ERROR\n | Error parsing command |
VER\n
Displays cerebellum firmware version number.
Returns: | ||
Cerebellum ver. 1.0.0\nOK\n | Command completed |