Skip to content

Commit e639ef4

Browse files
author
Alexandre Prost
committed
[Fix] follow line
1 parent 28e73fe commit e639ef4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

elio.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,22 +296,22 @@ def followLine():
296296
print(sensor1_value, sensor2_value, sensor3_value)
297297

298298
# Line following logic
299-
if sensor2_value(2) < threshold + 1500:
299+
if sensor2_value < threshold + 1500:
300300
# Line detected by middle sensor, move forward
301301
AIN1.duty_cycle = 0
302302
AIN2.duty_cycle = 65535
303303
BIN1.duty_cycle = 0
304304
BIN2.duty_cycle = 65535
305305

306-
elif sensor1_value(0) < threshold - 9500:
306+
elif sensor1_value < threshold - 9500:
307307
# Line detected by left sensor, turn left
308308
AIN1.duty_cycle = 0
309309
AIN2.duty_cycle = 8000
310310
BIN1.duty_cycle = 8000
311311
BIN2.duty_cycle = 0
312312

313313

314-
elif sensor3_value(4) < threshold - 9500:
314+
elif sensor3_value < threshold - 9500:
315315
# Line detected by right sensor, turn right
316316
AIN1.duty_cycle = 8000
317317
AIN2.duty_cycle = 0

0 commit comments

Comments
 (0)