From 10fed3fb257c92dada4e227fa4c1dc3c9a919921 Mon Sep 17 00:00:00 2001 From: zhaoliang <zhz03@g.ucla.edu> Date: Fri, 15 Oct 2021 15:04:25 -0700 Subject: [PATCH] change the slave code --- .../Two-way/ESP32_slave/ESP32_slave.ino | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Code/ESP32_communication/Two-way/ESP32_slave/ESP32_slave.ino b/Code/ESP32_communication/Two-way/ESP32_slave/ESP32_slave.ino index 93104d8..2954246 100644 --- a/Code/ESP32_communication/Two-way/ESP32_slave/ESP32_slave.ino +++ b/Code/ESP32_communication/Two-way/ESP32_slave/ESP32_slave.ino @@ -60,7 +60,7 @@ void OnDataRecv(const uint8_t * mac, const uint8_t *incomingData, int len) { void setup() { // Init Serial Monitor - Serial.begin(115200); + Serial.begin(9600); // Set device as a Wi-Fi Station WiFi.mode(WIFI_STA); @@ -94,13 +94,13 @@ void setup() { void loop() { ChangeVariables(); - if(lidar_thres < 300 && seeking_speed < 50){ - receivedData.DebugM = "catch ball and seeking for goal"; + if(lidar_thres < 200 && seeking_speed < 50){ + receivedData.DebugM = "ca b se g"; send_message(); - }else if(lidar_thres < 300 && seeking_speed > 50){ + }else if(lidar_thres < 200 && seeking_speed > 50){ receivedData.DebugM = "catch ball"; send_message(); - }else if (lidar_thres > 300 && seeking_speed < 50){ + }else if (lidar_thres > 200 && seeking_speed < 50){ receivedData.DebugM = "seeking"; send_message(); } -- GitLab