Skip to content

Instantly share code, notes, and snippets.

@lettergram lettergram/pluero.py

Created Mar 24, 2015
Embed
What would you like to do?
pleuro = nxt.locator.find_one_brick()
m_left = Motor(pleuro, PORT_A)
m_right = Motor(pleuro, PORT_C)
motors = SynchronizedMotors(m_left, m_right, 0)
decision = 2 # Created a variable called decision and set it = 2
while(1):
decision = forward(pleuro, motors, 80, 15)
motors.brake()
if(decision is 0): # dist traversed
random_turn(pleuro)
elif(decision is 1): # prox alarm
avoid_turn(pleuro)
elif(decision is 2): # food alarm
defend(pleuro, 5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.