Codigo robonova

Solo disponible en BuenasTareas
  • Páginas : 3 (578 palabras )
  • Descarga(s) : 0
  • Publicado : 4 de febrero de 2012
Leer documento completo
Vista previa del texto
' P1
GOSUB forward_standup
GOSUB standard_pose
GOTO main_exit'================================================
' templet program
'
' RR : internal parameter variable / ROBOREMOCON / Actioncommand
' A : temporary variable / REMOCON
' A16,A26 : temporary variable
'
'== auto_main ===================================
GOTO AUTO
FILL 255,10000

DIM RR AS BYTE
DIM A AS BYTEDIM A16 AS BYTE
DIM A26 AS BYTE

CONST ID = 0 ' 1:0, 2:32, 3:64, 4:96,

'== Action command check (50 - 82)
IF RR > 50 AND RR < 83 THEN GOTO action_proc

RR = 0

PTP SETONPTP 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===================
TEMPO 230
MUSIC "CDE"
GETMOTORSET G24,1,1,1,1,1,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,1,1,0
'== motor power on =============================
SPEED 5
MOTOR G24
GOSUB standard_pose'================================================
MAIN:
GOSUB robot_voltage
'GOSUB robot_tilt

'-----------------------------
IF RR = 0 THEN GOTO MAIN1

ON RR GOTOMAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,K15,K16,K17,K18,K19,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K30,K31,K32
GOTO main_exit
'-----------------------------
MAIN1:
A = REMOCON(1)
A = A - ID
ON A GOTOMAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,K15,K16,K17,K18,K19,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K30,K31,K32
GOTO MAIN
'-------------------------------------------------
action_proc:
A = RR -50
ON A GOTO MAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,K15,K16,K17,K18,K19,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K30,K31,K32
RETURN
'-----------------------------
main_exit:
IF RR> 50 THEN RETURN
RR = 0
GOTO MAIN
'================================================
k1:
GOSUB bow_pose
GOSUB standard_pose
GOTO main_exit
k2:
GOSUB hans_up
DELAY 500
GOSUB...
tracking img