Arduino/Rasperry Pi Communication
The Arduino and Rasperry Pi communicate via the Serial interface. The protocol is line-based with a single character prefix determining command type.
Arduino Originated Commands
A debug message from the Arduino.
Data: The message.
A data log message from the Arduino.
Data: A tab-separated list of values of:
- Timestamp in milliseconds since Arduino start
- Last run duration in microseconds
- Accelerometer X-axis
- Accelerometer Y-axis
- Accelerometer Z-axis
- Gyroscope X-axis
- Gyroscope Y-axis
- Gyroscope Z-axis
- Motor Adjust (increase/decrease in output from stabilization algorithm) front-left
- Motor Adjust front-right
- Motor Adjust back-right
- Motor Adjust back-left
- Position: X-rotation
- Position: Y-rotation
- PID A (FL/BR) error
- PID B (FR/BL) error
Raspberry Pi Originated Commands
Arm the Arduino motors and engage control.
Data: "1" to arm or "0" to disarm.
Sets the master motor speed.
Data: Motor speed between 0.0 and 100.0 as a percentage of max speed.
To set to 50%:
To set to 12.5%: