repository to manage all files related to the makeathon farm bot project (Software + Documentation).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

drive_arm.py 468B

1234567891011121314151617
  1. #!/usr/bin/env python3
  2. from ev3dev2.motor import Motor, OUTPUT_B, OUTPUT_C, SpeedPercent
  3. import sys
  4. motorUpDown = Motor(OUTPUT_C)
  5. motorLeftRight = Motor(OUTPUT_B)
  6. plantID = int(sys.argv[1])
  7. # Set direction of arm rotation back to middle
  8. if plantID % 2 == 0:
  9. leftRight = 50 # rotating right
  10. else:
  11. leftRight = -50 # rotating left
  12. motorUpDown.on_for_seconds(SpeedPercent(-50), seconds=2.8)
  13. motorLeftRight.on_for_degrees(SpeedPercent(leftRight), 400)