Shop OBEX P1 Docs P2 Docs Learn Events
How to get servo to work on propeller? — Parallax Forums

How to get servo to work on propeller?

dirtrider444dirtrider444 Posts: 33
edited 2013-01-04 08:32 in Propeller 1
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

Comments

  • dirtrider444dirtrider444 Posts: 33
    edited 2013-01-03 22:57
    Hope this helps for future people wondering the same question.....Credit to Duane Degn for helping another member on same topic


    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)
  • StefanL38StefanL38 Posts: 2,292
    edited 2013-01-04 08:32
    Hi,

    attachment.php?attachmentid=78421&d=1297987572
Sign In or Register to comment.