var etat=0 var a[2]=[0,0] var NoirOuBlanc = 0 timer.period[0] = 0 call sound.system(-1) call leds.top(0,0,0) call leds.bottom.left(0,0,0) call leds.bottom.right(0,0,0) call leds.circle(0,0,0,0,0,0,0,0) onevent buttons if button.center == 1 then motor.left.target = 0 motor.right.target = 0 end if button.forward == 1 then motor.left.target = 50 motor.right.target = 50 end if button.forward == 1 then timer.period[0] = 14300 end onevent prox if prox.ground.reflected[0]>= 800 and prox.ground.reflected[1] >= 800 then NoirOuBlanc = 1 elseif prox.ground.reflected[0] <= 200 and prox.ground.reflected[1] <= 200 then NoirOuBlanc = 0 end onevent timer0 timer.period[0] = 0 motor.left.target = 0 motor.right.target = 0