Skip to content

Commit 00c7e9b

Browse files
committed
Update quadripod.ino
1 parent c0156c7 commit 00c7e9b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

quadripod.ino

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,11 @@ void loop()
190190

191191

192192
if (cycle==5){
193-
// No delay
193+
// No delay
194+
if (dir==FORWARD) {
195+
distance = readDist();
196+
}
197+
194198
} else {
195199
if(dir==LEFT or dir==RIGHT){
196200
delay(looptime*robotspeed);
@@ -218,11 +222,6 @@ void loop()
218222
}
219223
}
220224

221-
if (cycle==5) {
222-
if (dir==FORWARD) {
223-
distance = readDist();
224-
}
225-
}
226225

227226
if (distance < 40){
228227
digitalWrite(ledPin, HIGH);

0 commit comments

Comments
 (0)