Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #define ARB_SIZE_POSE 7 // pose size: a single param for size of pose
00031 #define ARB_LOAD_POSE 8 // load pose: index, then pose positions (# of params = 2*pose_size)
00032 #define ARB_LOAD_SEQ 9 // seq size: a single param for the size of the seq
00033 #define ARB_PLAY_SEQ 10 // load seq: index/times (# of params = 3*seq_size)
00034 #define ARB_LOOP_SEQ 11 // play seq: no params
00035
00036 #define ARB_CONTROL_SETUP 26 // write ids: id of controller, params (usually ids of servos, # of params = pose_size + 1)
00037 #define ARB_CONTROL_WRITE 27 // write positions: positions in order of servos (# of params = 2*pose_size)
00038 #define ARB_CONTROL_STAT 28 // retrieve status: id of controller
00039 #define ARB_SYNC_READ 0x84
00040
00041
00042 #define REG_MODEL_NUMBER_L 0
00043 #define REG_MODEL_NUMBER_H 1
00044 #define REG_VERSION 2
00045 #define REG_ID 3
00046 #define REG_BAUD_RATE 4
00047
00048 #define REG_DIGITAL_IN0 5 // First block of digital pins to read
00049 #define REG_DIGITAL_IN1 6
00050 #define REG_DIGITAL_IN2 7
00051 #define REG_DIGITAL_IN3 8
00052
00053 #define REG_RESCAN 15
00054 #define REG_RETURN_LEVEL 16
00055 #define REG_ALARM_LED 17
00056 #define REG_ANA_BASE 18 // First Analog Port
00057 #define REG_SERVO_BASE 26 // Up to 10 servos, each uses 2 bytes (L, then H), pulse width (0, 1000-2000ms)
00058 #define REG_MOVING 46
00059
00060 #define REG_DIGITAL_OUT0 47 // First digital pin to write
00061
00062
00063 #define REG_RESERVED 79 // 79 -- 99 are reserved for future use
00064 #define REG_USER 100 //
00065
00066
00067 int mode = 0;
00068
00069 unsigned char id = 0;
00070 unsigned char length = 0;
00071 unsigned char ins = 0;
00072
00073 unsigned char params[143];
00074 unsigned char index = 0;
00075
00076 int checksum;