Fixing up phaseTwo()

This commit is contained in:
2026-02-03 07:07:57 +00:00
parent 7cd3ad3a87
commit a2c397d6ca

View File

@@ -179,7 +179,7 @@ if (WiFi.status() == WL_CONNECTED) {
void loop() {
// ph1 = true;
// ph2 = true;
// ph3 = true;
ph3 = true;
if (!ph1) {
@@ -198,7 +198,7 @@ void loop() {
}
// motorsTest();
sensorsTest();
// sensorsTest();
}
@@ -256,14 +256,14 @@ void phaseTwo() {
receiveSensorData();
while (!p2_stop) {
// while (!p2_stop) {
while ((sens_FL + sens_FR) / 2 > 8000) {
motorsGo(-255);
motorsGo(-230);
delay(5); // Wait for new sensor data to arrive
receiveSensorData(); // Get fresh reading each iteration
}
while ((sens_FL + sens_FR) / 2 < 680) { // Used to be 680
motorsGo(-180);
while ((sens_FL + sens_FR) / 2 < 800) { // Used to be 680
motorsGo(-250);
delay(5); // Wait for new sensor data to arrive
receiveSensorData(); // Get fresh reading each iteration
}
@@ -272,9 +272,9 @@ void phaseTwo() {
delay(5); // Wait for new sensor data to arrive
receiveSensorData(); // Get fresh reading each iteration
}
p2_stop = true;
receiveSensorData();
}
// p2_stop = true;
// receiveSensorData();
// }
motorsStop();