18 lines
468 B
Python
18 lines
468 B
Python
|
#!/usr/bin/env python3
|
||
|
from ev3dev2.motor import Motor, OUTPUT_B, OUTPUT_C, SpeedPercent
|
||
|
import sys
|
||
|
|
||
|
motorUpDown = Motor(OUTPUT_C)
|
||
|
motorLeftRight = Motor(OUTPUT_B)
|
||
|
|
||
|
plantID = int(sys.argv[1])
|
||
|
|
||
|
# Set direction of arm rotation back to middle
|
||
|
if plantID % 2 == 0:
|
||
|
leftRight = 50 # rotating right
|
||
|
else:
|
||
|
leftRight = -50 # rotating left
|
||
|
|
||
|
motorUpDown.on_for_seconds(SpeedPercent(-50), seconds=2.8)
|
||
|
motorLeftRight.on_for_degrees(SpeedPercent(leftRight), 400)
|