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: