xanadu
03-28-2012, 12:20 AM
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?
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...
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...