by rino2 » Mon Aug 17, 2009 8:53 am
by rino2
Mon Aug 17, 2009 8:53 am
Hi to all!!!
I'm new here so I beg your pardon if the question is alrerady solved!!
I'm traing to move shoulder, elbow and grip tool, step by step using the SERVO istruction because for each movement I want to check for a key pressed to stop the movements.
The problem is quite simple... When the servo must move from 10 or 100 to max (190) there is non problem..
EG.
L_Harm_up: ' Shoulder rotation UP
arm_ud =MOTORIN(6)
wmi_max =190
FOR wmi =arm_ud TO wmi_max
GOSUB in_key
SERVO 6,wmi
DELAY 50
NEXT wmi
GOTO GetCmnd
But when it must move from max to min (eg 190 to 10 or 100)... here his the problem!!!!
FOR ...NEXT need the final value to be greater than the start (wmi_max greater than wmi), RoboBasic cant use negative number.....
So... there is a solution?? Can some one suggest me a way to work out?
To be clear... think to the shoulder... if I move it UP the renge value is correcti wmi is less than the maximum (190)... but is the shoulder must go down the final position of the motor is LESS than the start.....
Please I need your help!!!
Ciao
from Italy
Rino
Hi to all!!!
I'm new here so I beg your pardon if the question is alrerady solved!!
I'm traing to move shoulder, elbow and grip tool, step by step using the SERVO istruction because for each movement I want to check for a key pressed to stop the movements.
The problem is quite simple... When the servo must move from 10 or 100 to max (190) there is non problem..
EG.
L_Harm_up: ' Shoulder rotation UP
arm_ud =MOTORIN(6)
wmi_max =190
FOR wmi =arm_ud TO wmi_max
GOSUB in_key
SERVO 6,wmi
DELAY 50
NEXT wmi
GOTO GetCmnd
But when it must move from max to min (eg 190 to 10 or 100)... here his the problem!!!!
FOR ...NEXT need the final value to be greater than the start (wmi_max greater than wmi), RoboBasic cant use negative number.....
So... there is a solution?? Can some one suggest me a way to work out?
To be clear... think to the shoulder... if I move it UP the renge value is correcti wmi is less than the maximum (190)... but is the shoulder must go down the final position of the motor is LESS than the start.....
Please I need your help!!!
Ciao
from Italy
Rino