View difference between Paste ID: 3dDvuKBP and DssdcEmb
SHOW: | | - or go back to the newest paste.
1-
import MotorBridgeI
1+
from MotorBridgeI import MotorBridgeCape
2
from time import sleep
3
4-
ServoName   =  1
4+
servo_name  =  1
5-
Frequency   =  50
5+
frequency   =  50
6
7-
motor = MotorBridgeI.MotorBridgeCape()
7+
motor = MotorBridgeCape()
8-
motor.ServoInit(ServoName, Frequency)
8+
motor.ServoInit( servo_name, frequency )
9
10-
for angle in ( 0, 45, 90, 135, 180, 135, 90, 45, 0 ):
10+
for angle in 0, 45, 90, 135, 180, 135, 90, 45, 0:
11
    sleep( 0.5 )
12-
    motor.ServoMoveAngle(ServoName, angle)
12+
    motor.ServoMoveAngle( servo_name, angle )