Servo32v7 Object
xanadu
Posts: 3,347
I can get the servos to move using this object, but I cannot get them to ramp. Using the ramp command makes the servo stay still when the code is run. Any ideas?
The regular non-ramping command SERVO.Set(ServoCh1,1500) works okay...
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 ServoCh1 = 31 OBJ SERVO : "Servo32v7.spin" PUB servorun SERVO.Start SERVO.ramp SERVO.set(ServoCh1,1500) repeat SERVO.SetRamp(ServoCh1,700,500) waitcnt(clkfreq * 5 + cnt) SERVO.SetRamp(ServoCh1,1500,500) waitcnt(clkfreq * 5 + cnt) SERVO.SetRamp(ServoCh1,2200,500) waitcnt(clkfreq * 5 + cnt) SERVO.SetRamp(ServoCh1,1500,500) waitcnt(clkfreq * 5 + cnt)
The regular non-ramping command SERVO.Set(ServoCh1,1500) works okay...
Comments
Maybe change 500 to 50 and see if that helps...
I also re-downloaded the servo object, loaded the demo and changed the servo pin and that doesn't work either.
So... just for the heck of it I put the servo on pin 30 instead of 31 and it works better, but glitchy. I moved it to pin 6 and it works great. Does that mean my Prop is bad?
simply test with a pin within the range 0..27. If you have something like the demoboard choose a pin-number
that has nothing else connected.
best regards
Stefan
So, like Stefan said, better to not use P30&P31. Or, if you're using a Prop Plug, you can remove it...
Wow, thanks guys I had not realized that pin was shared, or forgot since I started using the Prop Proto.