From 8353103e1ff6183630f6722d9f5dfd2a2755e0a1 Mon Sep 17 00:00:00 2001 From: Aadi Desai <21363892+supleed2@users.noreply.github.com> Date: Tue, 15 Jun 2021 08:55:42 +0100 Subject: [PATCH] Add colour selection to Command<->Control reference doc --- Control/ref/command.cpp | 4 +++- Control/src/main.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Control/ref/command.cpp b/Control/ref/command.cpp index 9360b9a..8556faf 100644 --- a/Control/ref/command.cpp +++ b/Control/ref/command.cpp @@ -5,7 +5,7 @@ #define WebSocket 0 int state, totalTripDistance, currentHeading, current_x, current_y, signal_strength, lastCompletedCommand_id; // Info Control ==> Command float batteryVoltage, batteryLevel, batteryCycles; // Info Control ==> Command -int command_id, mode, reqHeading, reqDistance, reqCharge, reqTime; // Info Command ==> Control +int command_id, mode, reqHeading, reqDistance, reqCharge, reqTime, reqColour; // Info Command ==> Control float reqSpeed; // Info Command ==> Control void setup() {} @@ -37,10 +37,12 @@ void loop() // 1 = Normal movement command, 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 + // 4 = Change colour tracking using Vision tdoc["rH"] = reqHeading; tdoc["rD"] = reqDistance; tdoc["rS"] = reqSpeed; tdoc["rC"] = reqCharge; tdoc["pSt"] = reqTime; + tdoc["col"] = reqColour; serializeJson(tdoc, WebSocket, WebSocket); // Build JSON and send on UART1 } diff --git a/Control/src/main.cpp b/Control/src/main.cpp index 06a9a49..9ab6ba8 100644 --- a/Control/src/main.cpp +++ b/Control/src/main.cpp @@ -202,7 +202,7 @@ void loop() case INSTR_COLOUR: { Status = CS_IDLE; - colour = instr->colour; + colour = (Colour_t)instr->colour; } break; default: