How to get servo to work on propeller?
dirtrider444
Posts: 33
I am trying to find a sample program to get my servo to work on my propeller proto board. Any help would be greatly appreciated!
thanks
taylor
thanks
taylor
Comments
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 'Note Clock Speed for your setup!! _Pin8 = 8 OBJ SERVO : "Servo32v7.spin"PUB Servo32_DEMO | temp SERVO.Start 'Start Servo handler waitcnt(clkfreq / 20 + cnt) repeat SERVO.Set(_Pin8,1500) 'Move Servo Center waitcnt(clkfreq * 2 + cnt) ' wait 2 seconds SERVO.Set(_Pin8,1000) 'Move Servo Clockwise (at least for most servos) waitcnt(clkfreq * 2 + cnt) SERVO.Set(_Pin8, 2000) 'Move Servo Counterclockwise waitcnt(clkfreq * 2 + cnt)