Motor code question
BarryFaux
Posts: 16
in BASIC Stamp
I am new to robots and so any help is appreciated. i want to ramp a motor from slow to full and maintain that full speed untill the ping sensor determines it needs to take action. Ive tried using the index variable but cant get it to stay at full no matter what i do. heres what i have so far
FOR index = 250 TO 0
PULSOUT esc,750+index
PAUSE 20
NEXT
ive changed the pause value but it just acts up.
FOR index = 250 TO 0
PULSOUT esc,750+index
PAUSE 20
NEXT
ive changed the pause value but it just acts up.
Comments
...FOR index = 0 to 250
as 750 is zero speed
FOR index =0 TO 250
PULSOUT esc, 750+ index
PAUSE 20
NEXT
DO
PULSOUT esc, 1000
LOOP
'ramp up
FOR index = 250 TO 0
PULSOUT esc,750+index
PAUSE 20
NEXT
'now maintain full speed while checking sensor
DO
PULSOUT esc,750
insert PING routine here
IF... THEN branch based on PING reading
IF... THEN branch based on PING reading
LOOP