Fixing up phaseTwo()
This commit is contained in:
@@ -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();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user