by UCROBOTS » Mon Mar 20, 2006 10:24 am
by UCROBOTS
Mon Mar 20, 2006 10:24 am
Pev,
try this code:
DIM A AS BYTE
DIM I AS BYTE
DIM B AS INTEGER
PTP SETON
PTP ALLON
''== motor diretion setting ======================
'DIR G6A,1,0,0,1,0,0
'DIR G6B,1,1,1,1,1,1
'DIR G6C,0,0,0,0,0,0
'DIR G6D,0,1,1,0,1,0
'
''== motor start position read ===================
'GETMOTORSET G6A,1,1,1,1,1,0
'GETMOTORSET G6B,1,1,1,0,0,0
'GETMOTORSET G6C,1,1,1,0,0,0
'GETMOTORSET G6D,1,1,1,1,1,0
'
' SPEED 5
'
''== motor power on =============================
'MOTOR G24
'================================================
MAIN:
TEMPO 230
MUSIC "o23ggaagg"
DELAY 1000
MOTOR 6
MOTOR 7
MOTOR 8
MOTOR 9
loop1:
MOVE G6B, 100,33,100, , , , 'left arm
MOVE G6B, 120,33,100, , , ,
WAIT
FOR I = 0 TO 255
B=SONAR(5)
PWM 2,I
Next I
GOTO loop1
GOTO MAIN
'================================================
and tell me what happens
Ulli
Pev,
try this code:
DIM A AS BYTE
DIM I AS BYTE
DIM B AS INTEGER
PTP SETON
PTP ALLON
''== motor diretion setting ======================
'DIR G6A,1,0,0,1,0,0
'DIR G6B,1,1,1,1,1,1
'DIR G6C,0,0,0,0,0,0
'DIR G6D,0,1,1,0,1,0
'
''== motor start position read ===================
'GETMOTORSET G6A,1,1,1,1,1,0
'GETMOTORSET G6B,1,1,1,0,0,0
'GETMOTORSET G6C,1,1,1,0,0,0
'GETMOTORSET G6D,1,1,1,1,1,0
'
' SPEED 5
'
''== motor power on =============================
'MOTOR G24
'================================================
MAIN:
TEMPO 230
MUSIC "o23ggaagg"
DELAY 1000
MOTOR 6
MOTOR 7
MOTOR 8
MOTOR 9
loop1:
MOVE G6B, 100,33,100, , , , 'left arm
MOVE G6B, 120,33,100, , , ,
WAIT
FOR I = 0 TO 255
B=SONAR(5)
PWM 2,I
Next I
GOTO loop1
GOTO MAIN
'================================================
and tell me what happens
Ulli