from leaphymicropython.sensors.linesensor import AnalogIR
from leaphymicropython.actuators.dcmotor import DCMotors
motoren = DCMotors()
motor_a = motoren.motor_a
motor_b = motoren.motor_b
a0 = AnalogIR("A0", 2500)
a1 = AnalogIR("A1", 2500)
while True:
a0_ir = a0.get_analog_value()
left = a0.black_or_white()
a1_ir = a1.get_analog_value()
right = a1.black_or_white()
if left == 'white' and right == 'white':
motor_a.forward(255)
motor_b.forward(255)
if left == 'white' and right == 'black':
motor_a.forward(255)
motor_b.forward(255)
if left == 'black' and right == 'white':
motor_a.forward(255)
motor_b.forward(255)
sleep(0.01)