Home » BLOG » MRPi1 – Waiter

MRPi1 – Waiter

The python program :

from mrpi1_lib import *
import time

# activer le controle
controlEnable()

# avancer de 30 cm
forwardC(15, 1200)

# boucle infini
while 1:
  # lecture capteur de proximité 3
  p = proxSensor(3)

  # pause de 0.5 seconde
  time.sleep(0.5)

  # si capteur > 300
  if p > 300:
    backC(15,1200) #reculer de 30 cm
exit()

 

Leave a Reply

Your email address will not be published. Required fields are marked *