Wire protocol
The Python side speaks a compact integer-command protocol to the PARROTard Arduino firmware. All commands are ASCII-encoded integers; some commands are followed by a second integer or float parameter.
Magic prefix
Most command IDs follow the pattern 1337XYZ, where 1337 is a
magic prefix and XYZ selects the subsystem:
Range |
Subsystem |
Examples |
|---|---|---|
|
comm test |
|
|
write-out / clock |
|
|
LED control |
|
|
experiment flow |
|
|
cameras |
|
|
bottom strip |
|
Comm-test handshake
Python sends the integer
1337.Arduino replies with the line
50 1337.cuewire.ArduinoSerial.comm_test()returnsTrueon success and raisescuewire.CommTestErroron failure.
Parameter-readout frame
In response to EXPgetParameter_return (13372999) the firmware
emits a single ``>>…<< `` frame with seven comma-separated fields:
>>pre_exp,exp,led_pattern,led_mode,led_free_period,led_sin_period,led_hall_factor<<
This is parsed into a cuewire.ExpParameters by
cuewire.huepfburg.parse_exp_parameters().
Continuous serial output
When write-out is enabled (13370001) the firmware emits one line
per 10-ms tick with the columns documented in the experiment-script
header. Toggle write-out off (13370000) before sending a
command-with-follow pair, to avoid races between the two streams.