Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- motor_a = Motor(Port.A)
- motor_b = Motor(Port.B)
- motor_c = Motor(Port.C)
- t1 = TouchSensor(Port.S1)
- t2 = TouchSensor(Port.S2)
- g = GyroSensor(Port.S3)
- motor_a.reset_angle(0)
- motor_b.reset_angle(0)
- while True:
- if t1.pressed() and t2.pressed(): # нажаты обе
- motor_c.run(560)
- elif t1.pressed(): # нажата левая
- motor_a.run_target(300,90)
- elif t2.pressed(): # нажата правая
- motor_b.run_target(300,90)
- else: # ни одна не нажата
- motor_b.run_target(300,0)
- motor_a.run_target(300,0)
- motor_c.stop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement