Hobby Servos
sicoloco55
Posts: 6
Hi:
My question is about hobby servos and the servo32v7.spin object found in the OBEX.
The instructions say that to center a servo the pulse width that is used is 1500, so y think this was for standard restringed servos not for the hobby servos.
An example:
In BS2 I use PULSOUT Pin, 550
to center de servo... I have to use the same width in the propeller with the Serv.Set method??
I have a Prop USB Board
And here is the code I wrote
My question is about hobby servos and the servo32v7.spin object found in the OBEX.
The instructions say that to center a servo the pulse width that is used is 1500, so y think this was for standard restringed servos not for the hobby servos.
An example:
In BS2 I use PULSOUT Pin, 550
to center de servo... I have to use the same width in the propeller with the Serv.Set method??
I have a Prop USB Board
And here is the code I wrote
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 VAR long stack[20] long puls OBJ Serv1 : "Servo32v7.spin" PUB Start | Pin repeat while true Pin := 5 Serv1.Start Serv1.Set(Pin, 1000) waitcnt(5_000_000 + cnt)
Comments
The Servo32v7.spin is designed to set and forget, meaning you don't need to keep making updates. Also, you don't need to keep launching the driver. In your repeat loop you keep starting. So the Servo commands should happen outside of the repeat loop, and the waitcnt can be removed from the repeat loop.
The DEMO associated with the OBEX file should be explanatory and provide adequate information to set this up. Let me know if you have any further problems and I'll see what we can do..
Rich H