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() { void loop() {
// ph1 = true; // ph1 = true;
// ph2 = true; // ph2 = true;
// ph3 = true; ph3 = true;
if (!ph1) { if (!ph1) {
@@ -198,7 +198,7 @@ void loop() {
} }
// motorsTest(); // motorsTest();
sensorsTest(); // sensorsTest();
} }
@@ -235,7 +235,7 @@ void phaseOne() {
motorsGo(80); motorsGo(80);
delay(1250); // Go into the pit 1800 miliseconds, delay(1250); // Go into the pit 1800 miliseconds,
motorsStop(); motorsStop();
delay(3000); //how long to pick balls? dunno delay(3000); //how long to pick balls? dunno
motorsGo(-150); motorsGo(-150);
delay(1200); // Go out of the pit 1800 miliseconds delay(1200); // Go out of the pit 1800 miliseconds
motorsStop(); motorsStop();
@@ -256,14 +256,14 @@ void phaseTwo() {
receiveSensorData(); receiveSensorData();
while (!p2_stop) { // while (!p2_stop) {
while ((sens_FL + sens_FR) / 2 > 8000) { while ((sens_FL + sens_FR) / 2 > 8000) {
motorsGo(-255); motorsGo(-230);
delay(5); // Wait for new sensor data to arrive delay(5); // Wait for new sensor data to arrive
receiveSensorData(); // Get fresh reading each iteration receiveSensorData(); // Get fresh reading each iteration
} }
while ((sens_FL + sens_FR) / 2 < 680) { // Used to be 680 while ((sens_FL + sens_FR) / 2 < 800) { // Used to be 680
motorsGo(-180); motorsGo(-250);
delay(5); // Wait for new sensor data to arrive delay(5); // Wait for new sensor data to arrive
receiveSensorData(); // Get fresh reading each iteration receiveSensorData(); // Get fresh reading each iteration
} }
@@ -272,9 +272,9 @@ void phaseTwo() {
delay(5); // Wait for new sensor data to arrive delay(5); // Wait for new sensor data to arrive
receiveSensorData(); // Get fresh reading each iteration receiveSensorData(); // Get fresh reading each iteration
} }
p2_stop = true; // p2_stop = true;
receiveSensorData(); // receiveSensorData();
} // }
motorsStop(); motorsStop();