User Manual
41
Check and set the channel.
channel = servo1.channel # get channel
servo1.channel = 1 # set channel
angle
Check and set the angle the servo spins to.
angle = servo1.angle # get angle
servo1.angle = 90 # set angle
offset
Offset value for the servo spinning. It is the pwm pulse width, ranging between [-4096, 4096].
offset = servo1.offset # get servo offset
servo1.offset = 120 # set servo offset
turn(angle)
Drive the servo to spin to a designated angle.
Transfer integer parameter for the angle, ranging between [0 ~ 180].
servo1.turn(90) # turn to angle
pwm.py
Control the pin pwm0~pwm7 to output pwm signals.
Generally to control the brightness of the LED. Please DO NOT drive servo directly with the
pwm module.
from pismart.pwm import PWM
from pismart.pismart import PiSmart
p = PiSmart()
pwm = PWM(0) # create pwm
p.servo_switch(1)
channel
SunFounder