User Manual

40
motorA.end() # motor end
servo.py
Control the servo connected to PiSmart to spin to a designated angle.
Create an instance, with 2 parameters:
channel: integer ranging between [0~7], for pwm0~pwm7 on PiSmart respetively.
offset: integer ranging between [0~180], offset value of accuracy of the servo spinning.
from pismart.servo import Servo
from pismart.pismart import PiSmart
p = PiSmart()
servo1 = Servo(0) # creat servo with0 ch.0
p.servo_switch(1)
min_pulse_width
Check and set the minimum pulse width. Please set based on the servo specifications.
min_p_width = servo1.min_pulse_width # get min pulse width
servo1.min_pulse_width = 600 # set min pulse width
max_pulse_width
Check and set the maximum pulse width. Please set based on the servo specifications.
max_p_width = servo1.max_pulse_width # get max pulse width
servo1.max_pulse_width = 2400 # set max pulse width
frequency
Check and set the pulse frequency. Please set based on the servo specifications.
min_width = servo1.frequency # get frequency
servo1.frequency = 60 # set frequency
channel
SunFounder