Serial Comms Protocol - brumster/EDTracker2 GitHub Wiki
EDTracker DIY uses a serial communication port to pass control messages and debug information between the device and the connected EDTracker user interface. Users can potentially debug a device by connecting their favourite terminal emulator to this serial port and passing simple commands to the device. The following lists the commands and operations available via this mechanism.
Prompt the arduino to say Hello back.
Turns on serial output from Arduino
Arduino sends basic sketch/config data back to UI
Tells the Arduino to stop talking over serial. Sent by UI when minimised or closed.
Tells Arduino to calculate gyro/accel bias values.
Tell arduino to toggle response mode (linear , exponential).
Tell arduino to toggle polling/interrupt mode
Restore Factory settings on Arduino.
M/m Increment/Decrement gyro x axis bias N/n Increment/Decrement gyro y axis bias O/o Increment/Decrement gyro z axis bias
j/J Increment/Decrement accel x axis bias k/K Increment/Decrement accel y axis bias l/L Increment/Decrement accel z axis bias
c/C Nudge yaw scale down by either 0.25 or 1.0 d/G Nudge yaw scale up by either 0.25 or 1.0 e/E Nudge pitch scale down by either 0.25 or 1.0 f/F Nudge pitcg scale up by either 0.25 or 1.0
Recentre the current view
Toggle autocentre behaviour (6050 only)
D - Save current drift compensation (6050 only) A/a Nudge Drift Compensation up/down
Toggle orientation (increments 0 to 6 then wraps back to 0 - see below) 0 Top/USB Right 1 Top/USB Front 2 Top/USB Left 3 Top/USB Rear 4 Left/USB Down 5 Right/USB Down
Character Received | Description |
---|---|
S | Indicates Arduino is in silent mode (no serial output) |
H | Hello from Arduino. UI then sends a V (to put it into Verbose mode and I to get basic info |
h | Hello from Arduino while it's auto calibration (Hi but I'm busy...) |
a | bias adjust enabled for all axis |
x | bias adjust only enabled for x axis |
y | bias adjust only enabled for y axis |
z | bias adjust only enabled for z axis |
V | Inidcates Arduino now in Verbose mode and talking to UI |
M | Generic message from Arduino (single string) |
q x 12 | Magnetometer calibration Matrix and offset data |
Q x 3 | Latest raw (uncalibrated) Magnetometer values (x/y/z) |
s | Response scaling mode (0 is linear, 1 is exponential) followed by pitch scaling and then yaw scaling |
p | 1 indicates arduino is polling sensors, 0 indicates it's using hardware interrupt |
# | Auto recenter mode (0= offset, 1= Soft, 2= Medium, 3= Hard) |
I | Info about current sketch version etc |
D < float> | Yaw Drift followed by current Yaw Drift Compensation |
T | Sensor temperature reading |
O | Device Orientation |
R | Device has recentered |
B x6 | Current gyro and acceleromter bias values |
If a line is recieved over serial which does not start with a command then it will be a 'live data' message; x3 Yaw/Pitch/Roll x3 Accelerometer X/Y/Z x3 gyro X/Y/Z