mirror of
https://github.com/supleed2/ELEC50003-P1-CW.git
synced 2024-11-10 01:35:50 +00:00
Update Command<->Control reference doc
This commit is contained in:
parent
5667ef67f2
commit
1d29735429
|
@ -3,7 +3,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#define WebSocket 0
|
#define WebSocket 0
|
||||||
int batteryVoltage, totalTripDistance, currentHeading, current_x, current_y, signal_strength, lastCompletedCommand_id; // Info Command ==> Control
|
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 command_id, mode, reqHeading, reqDistance, reqSpeed, reqCharge; // Info Control ==> Command
|
||||||
|
|
||||||
void setup() {}
|
void setup() {}
|
||||||
|
@ -13,6 +13,7 @@ void loop()
|
||||||
DynamicJsonDocument rdoc(1024); // receive doc, not sure how big this needs to be
|
DynamicJsonDocument rdoc(1024); // receive doc, not sure how big this needs to be
|
||||||
deserializeJson(rdoc, WebSocket); // Take JSON input from WebSocket
|
deserializeJson(rdoc, WebSocket); // Take JSON input from WebSocket
|
||||||
batteryVoltage = rdoc["bV"];
|
batteryVoltage = rdoc["bV"];
|
||||||
|
batteryLevel = rdoc["bL"];
|
||||||
totalTripDistance = rdoc["tD"];
|
totalTripDistance = rdoc["tD"];
|
||||||
currentHeading = rdoc["cH"];
|
currentHeading = rdoc["cH"];
|
||||||
current_x = rdoc["pos"][0];
|
current_x = rdoc["pos"][0];
|
||||||
|
|
Loading…
Reference in a new issue