🖇️Serial Protocol

https://github.com/PetoiCamp/OpenCat/blob/3368dfd46d91cb453bb5fcca3ca4cf84712c922e/src/OpenCat.h#L204-L254


Last updated
Was this helpful?
Was this helpful?
//token list
#define T_ABORT 'a' //abort the calibration values
#define T_BEEP 'b' //b note1 duration1 note2 duration2 ... e.g. b12 8 14 8 16 8 17 8 19 4 \
//a single 'b' will toggle the melody on/off
#define T_CALIBRATE 'c' //send the robot to calibration posture for attaching legs and fine-tuning the joint offsets. \
//c jointIndex1 offset1 jointIndex2 offset2 ... e.g. c0 7 1 -4 2 3 8 5
#define T_REST 'd'
#define T_GYRO_FINENESS 'g' //adjust the finess of gyroscope adjustment to accelerate motion
#define T_GYRO_BALANCE 'G' //toggle on/off the gyro adjustment
#define T_INDEXED_SIMULTANEOUS_ASC 'i' //i jointIndex1 jointAngle1 jointIndex2 jointAngle2 ... e.g. i0 70 8 -20 9 -20 \
//a single 'i' will free the head joints if it were previously manually controlled.
#define T_JOINTS 'j' //A single "j" returns all angles. "j Index" prints the joint's angle. e.g. "j 8" or "j11".
#define T_SKILL 'k'
#define T_SKILL_DATA 'K'
#define T_INDEXED_SEQUENTIAL_ASC 'm' //m jointIndex1 jointAngle1 jointIndex2 jointAngle2 ... e.g. m0 70 0 -70 8 -20 9 -20
// #define T_MELODY 'o'
#define T_PAUSE 'p'
// #define T_SLOPE 'l'
#define T_SAVE 's' //save the calibration values
// #define T_TILT 't'
// #define T_MEOW 'u'
#define T_PRINT_GYRO 'v' //print the Gyro data once
#define T_VERBOSELY_PRINT_GYRO 'V' //toggle verbosely print Gyro data
// #define T_XLEG 'x'
// #define T_ACCELERATE '.'
// #define T_DECELERATE ','
#define T_RANDOM_MIND 'z' //toggle random behaviors in the RANDOM_MIND mode
#define T_QUERY '?'
#ifdef GROVE_SERIAL_PASS_THROUGH
#define T_READ 'R' //read pin R
#define T_WRITE 'W' //write pin W
#define TYPE_ANALOG 'a' // Ra(analog read) Wa(analog write)
#define TYPE_DIGITAL 'd' // Rd(digital read) Wd(digital write)
#endif
#define T_COLOR 'C' //change the eye colors of the RGB ultrasonic sensor
#define T_INDEXED_SIMULTANEOUS_BIN 'I' //I jointIndex1 jointAngle1 jointIndex2 jointAngle2 ... e.g. I0 70 8 -20 9 -20
#define T_INDEXED_SEQUENTIAL_BIN 'M' //M jointIndex1 jointAngle1 jointIndex2 jointAngle2 ... e.g. M0 70 0 -70 8 -20 9 -20
#define BINARY_COMMAND //disable the binary commands to save space for the simple random demo
#ifdef BINARY_COMMAND
#define T_BEEP_BIN 'B' //B note1 duration1 note2 duration2 ... e.g. B12 8 14 8 16 8 17 8 19 4
#define T_LISTED_BIN 'L' //a list of the DOFx joint angles: angle0 angle1 angle2 ... angle15
// #define T_SERVO_MICROSECOND 'w' //PWM width modulation
#define T_TEMP 'T' //call the last 'K' skill data received from the serial port
#endif
#define EXTENSION 'X'
#define EXTENSION_VOICE 'A'
#define EXTENSION_ULTRASONIC 'U'const char* skillNameWithType[]={"bdFI","bkI","bkLI","crFI","crLI","hlwI","mhFI","mhLI","pcFI","phFI","phLI","trFI","trLI","vtFI","vtLI","wkFI","wkLI","balanceI","buttUpI","calibI","droppedI","liftedI","restI","sitI","strI","zeroN","bfI","ckI","climbCeilI","fdI","ffI","hiI","jyI","pdI","peeI","puI","pu1I","rcI","rlLI","rtI","stpI","tsI",};