From fd76a692e1913d3fd77c265e311c19df55d252bd Mon Sep 17 00:00:00 2001 From: Aadi Desai <21363892+supleed2@users.noreply.github.com> Date: Mon, 7 Jun 2021 16:29:04 +0100 Subject: [PATCH] Add ability for Drive to request current heading from Control --- Control/ref/drive.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Control/ref/drive.cpp b/Control/ref/drive.cpp index 5658baf..8a59cdc 100644 --- a/Control/ref/drive.cpp +++ b/Control/ref/drive.cpp @@ -17,7 +17,7 @@ void loop() { DynamicJsonDocument rdoc(1024); // receive doc, not sure how big this needs to be deserializeJson(rdoc, Serial1); // Take JSON input from UART1 - int requiredHeading = rdoc["rH"]; + int requiredHeading = rdoc["rH"]; // if -1: command in progress, returning requested heading, dist/sp to be ignored int distance = rdoc["dist"]; float speed = rdoc["sp"]; int currentHeading = rdoc["cH"]; @@ -31,7 +31,7 @@ void loop() // Do Drive stuff, set the 5 values above DynamicJsonDocument tdoc(1024); // transmit doc, not sure how big this needs to be - tdoc["comp"] = commandComplete; + tdoc["comp"] = commandComplete; // If 0: command in progress, current heading requested tdoc["mW"] = powerUsage_mW; tdoc["mm"] = distTravelled_mm; tdoc["pos"][0] = current_x;