Hi there,
I was sifting through some code on the forums. I came across this:
' adjust rate
diff = GetVariable("servo_1_pos") - GetVariable("end_servo_1_pos")
if diff < 0 then diff = - diff
if diff < 1000 then
SetVariable "channel_1_rate", 3000
elseif diff < 500 then
SetVariable "channel_1_rate", 2000
elseif diff < 100 then
SetVariable "channel_1_rate", 100
end if
But It leaves me with a few questions.
1. diff = GetVariable("servo_1_pos") - GetVariable("end_servo_1_pos")
I take it that GetVariable("servo_1_pos") can be had from my set variable for the x servo commanded position from the COG_X variable, but GetVariable("end_servo_1_pos") leaves me wondering where that is taken from.
I have been searching for the last 3 days trying to figure out how to get that number.
I tried to use that code Like it was but not only could I not find end_servo_1_pos. I also could not get the rate to change in the SSC-32 module.
2. So just how do I go about reading it end position and setting the actual servo movenent rate?
Thanks,
Robert
|
|