mirror of
https://github.com/supleed2/ELEC50003-P1-CW.git
synced 2024-12-22 21:45:49 +00:00
Add ability to pause rover for a defined time to reference doc
This commit is contained in:
parent
24bd7db3a8
commit
b6cbfc7619
|
@ -5,7 +5,7 @@
|
||||||
#define WebSocket 0
|
#define WebSocket 0
|
||||||
int state, totalTripDistance, currentHeading, current_x, current_y, signal_strength, lastCompletedCommand_id; // Info Control ==> Command
|
int state, totalTripDistance, currentHeading, current_x, current_y, signal_strength, lastCompletedCommand_id; // Info Control ==> Command
|
||||||
float batteryVoltage, batteryLevel, batteryCycles; // Info Control ==> Command
|
float batteryVoltage, batteryLevel, batteryCycles; // Info Control ==> Command
|
||||||
int command_id, mode, reqHeading, reqDistance, reqCharge; // Info Command ==> Control
|
int command_id, mode, reqHeading, reqDistance, reqCharge, reqTime; // Info Command ==> Control
|
||||||
float reqSpeed; // Info Command ==> Control
|
float reqSpeed; // Info Command ==> Control
|
||||||
|
|
||||||
void setup() {}
|
void setup() {}
|
||||||
|
@ -36,9 +36,11 @@ void loop()
|
||||||
// 0 = Stop immediately, clear command cache
|
// 0 = Stop immediately, clear command cache
|
||||||
// 1 = Normal movement command, added to end of command cache
|
// 1 = Normal movement command, added to end of command cache
|
||||||
// 2 = Normal charge command, results in no motion, added to end of command cache
|
// 2 = Normal charge command, results in no motion, added to end of command cache
|
||||||
|
// 3 = Pause command, wait for defined time in seconds, added to end of command cache
|
||||||
tdoc["rH"] = reqHeading;
|
tdoc["rH"] = reqHeading;
|
||||||
tdoc["rD"] = reqDistance;
|
tdoc["rD"] = reqDistance;
|
||||||
tdoc["rS"] = reqSpeed;
|
tdoc["rS"] = reqSpeed;
|
||||||
tdoc["rC"] = reqCharge;
|
tdoc["rC"] = reqCharge;
|
||||||
|
tdoc["pSt"] = reqTime;
|
||||||
serializeJson(tdoc, WebSocket, WebSocket); // Build JSON and send on UART1
|
serializeJson(tdoc, WebSocket, WebSocket); // Build JSON and send on UART1
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue