This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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