by firefox » Fri Apr 06, 2007 8:05 pm
by firefox
Fri Apr 06, 2007 8:05 pm
Hi all
I am new to this (just recieved my RN-1 5 days ago
) I have assembled my RN-1 with no problems and installed matts grips ( Thanks Matt there great). I have been looking at the post and seen were some people are looking for ways to sense when the grips have grabbed somthing. I had a idea on using the motorin to check the servo position after telling the servo to move
. If the grip closes on a object then the servo position will not match the servo commanded position. I have tried the following program and it works. even got brave and put my finger in the grip
( with my other hand on the power switch just in case). Anyway this is only my 3rd day playing with robobasic so as a beginner I was would like to see if some more experienced programmers could rework my idea and post a improved version for all to share. I beleave there my be a simpler way to do the programming I just have to get some programming time under my belt.
SETUP:
DIM SER AS BYTE
DIM LOC AS BYTE
DIM GRP AS BYTE
GRP=0
SER = 50
GETMOTORSET G6A, 1,1,1,1,1,1
GETMOTORSET G6B, 1,1,1,1,1,1
GETMOTORSET G6C, 1,1,1,1,1,1
GETMOTORSET G6D, 1,1,1,1,1,1
LOC=MOTORIN(9)
MOTOR G24
SERVO 9,50
DELAY 1000
MAIN:
SER=SER+1
SERVO 9,SER
LOC=MOTORIN(9)
DELAY 300
LOC=LOC+1
IF LOC = SER THEN OUT 52,1
IF LOC <SER> 120 THEN GOTO QUIT
GOTO MAIN
GRIPCHECK:
GRP = GRP + 1
IF GRP = 6 THEN GOTO QUIT
RETURN
QUIT:
OUT 52,1
DELAY 4000
GOTO SETUP
Hi all
I am new to this (just recieved my RN-1 5 days ago
) I have assembled my RN-1 with no problems and installed matts grips ( Thanks Matt there great). I have been looking at the post and seen were some people are looking for ways to sense when the grips have grabbed somthing. I had a idea on using the motorin to check the servo position after telling the servo to move
. If the grip closes on a object then the servo position will not match the servo commanded position. I have tried the following program and it works. even got brave and put my finger in the grip
( with my other hand on the power switch just in case). Anyway this is only my 3rd day playing with robobasic so as a beginner I was would like to see if some more experienced programmers could rework my idea and post a improved version for all to share. I beleave there my be a simpler way to do the programming I just have to get some programming time under my belt.
SETUP:
DIM SER AS BYTE
DIM LOC AS BYTE
DIM GRP AS BYTE
GRP=0
SER = 50
GETMOTORSET G6A, 1,1,1,1,1,1
GETMOTORSET G6B, 1,1,1,1,1,1
GETMOTORSET G6C, 1,1,1,1,1,1
GETMOTORSET G6D, 1,1,1,1,1,1
LOC=MOTORIN(9)
MOTOR G24
SERVO 9,50
DELAY 1000
MAIN:
SER=SER+1
SERVO 9,SER
LOC=MOTORIN(9)
DELAY 300
LOC=LOC+1
IF LOC = SER THEN OUT 52,1
IF LOC <SER> 120 THEN GOTO QUIT
GOTO MAIN
GRIPCHECK:
GRP = GRP + 1
IF GRP = 6 THEN GOTO QUIT
RETURN
QUIT:
OUT 52,1
DELAY 4000
GOTO SETUP