by Humanoido » Thu May 03, 2007 1:59 am
by Humanoido
Thu May 03, 2007 1:59 am
In the original movie, the code is clear and easy to read. After being compressed and spun through YouTube it changed. So here's the original code with comments. There's only 26 program statements. Without the beeps, that could be cut to 24. There are ways to simplify it more, but then it loses clarity for beginners.
humanoido
'================================================
'NEW POSE TEMPLATE
'EXAMPLE PROGRAM BY HUMANOIDO 04.27.07
'================================================
DIM NEW_POSE AS BYTE
'================================================
DIR G6A,1,0,0,1,0,0 'SET MOTOR DIRECTIONS
DIR G6B,1,1,1,1,1,1 '0-COUNTERCLOCKWISE
DIR G6C,0,0,0,0,0,0 '1-CLOCKWISE
DIR G6D,0,1,1,0,1,0 'P86-7 ROBOBASIC MANUAL
'================================================
PTP SETON 'POINT TO POINT CONTROL FOR SMOOTH MOTION
PTP ALLON 'P88-90
'================================================
GETMOTORSET G6A,1,1,1,1,1,0 'MR-C3024 TO MOVE SERVOS TO ZERO
GETMOTORSET G6B,1,1,1,0,0,0 'DEGREES (0) POSITION OR MAINTAIN
GETMOTORSET G6C,1,1,1,0,0,0 'PRESET POSITION (1). AVOIDS SERVO
GETMOTORSET G6D,1,1,1,1,1,0 'DAMAGE, P105
SPEED 5 'SET MOTOR SPEED, P84
MOTOR G24 'POWER ON ALL MOTORS
'================================================
MAIN: 'MAIN PROGRAM
DELAY 500 'WAIT 1/2 SEC & START PROGRAM
GOSUB new_pose 'DO THE NEW STANCE
END 'END OF PROGRAM
'================================================
new_pose: 'NEW STANCE ROUTINE
TEMPO 230 'ADD SOME MUSICAL
MUSIC "CDEFG" 'BEEPS HERE
MOVE G6A,101, 75, 143, 94, 99, 100 ' MOVE SERVOS CODE
MOVE G6B,102, 63, 18, 100, 100, 100 ' ESTABLISHED FROM
MOVE G6C,100, 65, 18, 100, 100, 100 ' MOTION CAPTURE
MOVE G6D,102, 74, 141, 94, 98, 100 ' AND PASTE HERE
WAIT 'WAIT FOR FINISH
RETURN 'GO BACK TO MAIN PROGRAM
'================================================
In the original movie, the code is clear and easy to read. After being compressed and spun through YouTube it changed. So here's the original code with comments. There's only 26 program statements. Without the beeps, that could be cut to 24. There are ways to simplify it more, but then it loses clarity for beginners.
humanoido
'================================================
'NEW POSE TEMPLATE
'EXAMPLE PROGRAM BY HUMANOIDO 04.27.07
'================================================
DIM NEW_POSE AS BYTE
'================================================
DIR G6A,1,0,0,1,0,0 'SET MOTOR DIRECTIONS
DIR G6B,1,1,1,1,1,1 '0-COUNTERCLOCKWISE
DIR G6C,0,0,0,0,0,0 '1-CLOCKWISE
DIR G6D,0,1,1,0,1,0 'P86-7 ROBOBASIC MANUAL
'================================================
PTP SETON 'POINT TO POINT CONTROL FOR SMOOTH MOTION
PTP ALLON 'P88-90
'================================================
GETMOTORSET G6A,1,1,1,1,1,0 'MR-C3024 TO MOVE SERVOS TO ZERO
GETMOTORSET G6B,1,1,1,0,0,0 'DEGREES (0) POSITION OR MAINTAIN
GETMOTORSET G6C,1,1,1,0,0,0 'PRESET POSITION (1). AVOIDS SERVO
GETMOTORSET G6D,1,1,1,1,1,0 'DAMAGE, P105
SPEED 5 'SET MOTOR SPEED, P84
MOTOR G24 'POWER ON ALL MOTORS
'================================================
MAIN: 'MAIN PROGRAM
DELAY 500 'WAIT 1/2 SEC & START PROGRAM
GOSUB new_pose 'DO THE NEW STANCE
END 'END OF PROGRAM
'================================================
new_pose: 'NEW STANCE ROUTINE
TEMPO 230 'ADD SOME MUSICAL
MUSIC "CDEFG" 'BEEPS HERE
MOVE G6A,101, 75, 143, 94, 99, 100 ' MOVE SERVOS CODE
MOVE G6B,102, 63, 18, 100, 100, 100 ' ESTABLISHED FROM
MOVE G6C,100, 65, 18, 100, 100, 100 ' MOTION CAPTURE
MOVE G6D,102, 74, 141, 94, 98, 100 ' AND PASTE HERE
WAIT 'WAIT FOR FINISH
RETURN 'GO BACK TO MAIN PROGRAM
'================================================