mirror of
https://github.com/supleed2/ELEC50003-P1-CW.git
synced 2024-12-22 13:35:49 +00:00
Update Command<->Control reference doc
Add Rover state and correct comments
This commit is contained in:
parent
1d29735429
commit
52e14dfaa8
|
@ -3,8 +3,8 @@
|
|||
#include <string>
|
||||
|
||||
#define WebSocket 0
|
||||
int batteryVoltage, batteryLevel, totalTripDistance, currentHeading, current_x, current_y, signal_strength, lastCompletedCommand_id; // Info Command ==> Control
|
||||
int command_id, mode, reqHeading, reqDistance, reqSpeed, reqCharge; // Info Control ==> Command
|
||||
int state, batteryVoltage, batteryLevel, totalTripDistance, currentHeading, current_x, current_y, signal_strength, lastCompletedCommand_id; // Info Control ==> Command
|
||||
int command_id, mode, reqHeading, reqDistance, reqSpeed, reqCharge; // Info Command ==> Control
|
||||
|
||||
void setup() {}
|
||||
|
||||
|
@ -12,6 +12,7 @@ void loop()
|
|||
{
|
||||
DynamicJsonDocument rdoc(1024); // receive doc, not sure how big this needs to be
|
||||
deserializeJson(rdoc, WebSocket); // Take JSON input from WebSocket
|
||||
state = rdoc["st"]; // State: -1 = Error, 0 = Idle, 1 = Moving, 2 = Charging
|
||||
batteryVoltage = rdoc["bV"];
|
||||
batteryLevel = rdoc["bL"];
|
||||
totalTripDistance = rdoc["tD"];
|
||||
|
|
Loading…
Reference in a new issue