Utilisation de 3 NeoPixels sur 3 sorties différentes

Dependencies:   NeoStrip mbed

Committer:
dbrousse
Date:
Tue Dec 05 14:08:21 2017 +0000
Revision:
4:30925cc75b67
Parent:
0:129e8567ddbd
MX28-SCAN3D

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dbrousse 0:129e8567ddbd 1 // *** DO NOT MODIFY THESE CONSTANTS ***
dbrousse 0:129e8567ddbd 2 #define MX28_BUFFER_SIZE 0x8F
dbrousse 0:129e8567ddbd 3
dbrousse 0:129e8567ddbd 4 #define MX28_PROTOCOL_COMMAND_RESPONSE_TIMEOUT_MS 200
dbrousse 0:129e8567ddbd 5
dbrousse 0:129e8567ddbd 6 #define MX28_PROTOCOL_HEADER_0 0xFF
dbrousse 0:129e8567ddbd 7 #define MX28_PROTOCOL_HEADER_1 0xFF
dbrousse 0:129e8567ddbd 8
dbrousse 0:129e8567ddbd 9 #define MX28_PROTOCOL_BROADCAST_ID 0xFE
dbrousse 0:129e8567ddbd 10
dbrousse 0:129e8567ddbd 11 // EEPROM Area
dbrousse 0:129e8567ddbd 12 #define MX28_MODEL_NUMBER_L 0x00
dbrousse 0:129e8567ddbd 13 #define MX28_MODEL_NUMBER_H 0x01
dbrousse 0:129e8567ddbd 14 #define MX28_VERSION 0x02
dbrousse 0:129e8567ddbd 15 #define MX28_ID 0x03
dbrousse 0:129e8567ddbd 16 #define MX28_BAUD_RATE 0x04
dbrousse 0:129e8567ddbd 17 #define MX28_RETURN_DELAY_TIME 0x05
dbrousse 0:129e8567ddbd 18 #define MX28_CW_ANGLE_LIMIT_L 0x06
dbrousse 0:129e8567ddbd 19 #define MX28_CW_ANGLE_LIMIT_H 0x07
dbrousse 0:129e8567ddbd 20 #define MX28_CCW_ANGLE_LIMIT_L 0x08
dbrousse 0:129e8567ddbd 21 #define MX28_CCW_ANGLE_LIMIT_H 0x09
dbrousse 0:129e8567ddbd 22 #define MX28_UP_LIMIT_TEMPERATURE 0x0B
dbrousse 0:129e8567ddbd 23 #define MX28_DOWN_LIMIT_VOLTAGE 0x0C
dbrousse 0:129e8567ddbd 24 #define MX28_UP_LIMIT_VOLTAGE 0x0D
dbrousse 0:129e8567ddbd 25 #define MX28_MAX_TORQUE_L 0x0E
dbrousse 0:129e8567ddbd 26 #define MX28_MAX_TORQUE_H 0x0F
dbrousse 0:129e8567ddbd 27 #define MX28_STATUS_RETURN_LEVEL 0x10
dbrousse 0:129e8567ddbd 28 #define MX28_ALARM_LED 0x11
dbrousse 0:129e8567ddbd 29 #define MX28_ALARM_SHUTDOWN 0x12
dbrousse 0:129e8567ddbd 30
dbrousse 0:129e8567ddbd 31 // RAM Area
dbrousse 0:129e8567ddbd 32 #define MX28_TORQUE_ENABLE 0x18
dbrousse 0:129e8567ddbd 33 #define MX28_LED_ENABLE 0x19
dbrousse 0:129e8567ddbd 34 #define MX28_D_GAIN 0x1A
dbrousse 0:129e8567ddbd 35 #define MX28_I_GAIN 0x1B
dbrousse 0:129e8567ddbd 36 #define MX28_P_GAIN 0x1C
dbrousse 0:129e8567ddbd 37 #define MX28_GOAL_POSITION_L 0x1E
dbrousse 0:129e8567ddbd 38 #define MX28_GOAL_POSITION_H 0x1F
dbrousse 0:129e8567ddbd 39 #define MX28_MOVING_SPEED_L 0x20
dbrousse 0:129e8567ddbd 40 #define MX28_MOVING_SPEED_H 0x21
dbrousse 0:129e8567ddbd 41 #define MX28_TORQUE_LIMIT_L 0x22
dbrousse 0:129e8567ddbd 42 #define MX28_TORQUE_LIMIT_H 0x23
dbrousse 0:129e8567ddbd 43 #define MX28_PRESENT_POSITION_L 0x24
dbrousse 0:129e8567ddbd 44 #define MX28_PRESENT_POSITION_H 0x25
dbrousse 0:129e8567ddbd 45 #define MX28_PRESENT_SPEED_L 0x26
dbrousse 0:129e8567ddbd 46 #define MX28_PRESENT_SPEED_H 0x27
dbrousse 0:129e8567ddbd 47 #define MX28_PRESENT_LOAD_L 0x28
dbrousse 0:129e8567ddbd 48 #define MX28_PRESENT_LOAD_H 0x29
dbrousse 0:129e8567ddbd 49 #define MX28_PRESENT_VOLTAGE 0x2A
dbrousse 0:129e8567ddbd 50 #define MX28_PRESENT_TEMPERATURE 0x2B
dbrousse 0:129e8567ddbd 51 #define MX28_REGISTERED_INSTRUCTION 0x2C
dbrousse 0:129e8567ddbd 52 #define MX28_MOVING 0x2E
dbrousse 0:129e8567ddbd 53 #define MX28_LOCK 0x2F
dbrousse 0:129e8567ddbd 54 #define MX28_PUNCH_L 0x30
dbrousse 0:129e8567ddbd 55 #define MX28_PUNCH_H 0x31
dbrousse 0:129e8567ddbd 56
dbrousse 0:129e8567ddbd 57 // Instruction set
dbrousse 0:129e8567ddbd 58 #define MX28_PING 0x01
dbrousse 0:129e8567ddbd 59 #define MX28_READ_DATA 0x02
dbrousse 0:129e8567ddbd 60 #define MX28_WRITE_DATA 0x03
dbrousse 0:129e8567ddbd 61 #define MX28_REG_WRITE 0x04
dbrousse 0:129e8567ddbd 62 #define MX28_ACTION 0x05
dbrousse 0:129e8567ddbd 63 #define MX28_RESET 0x06
dbrousse 0:129e8567ddbd 64 #define MX28_SYNC_WRITE 0x83
dbrousse 0:129e8567ddbd 65
dbrousse 0:129e8567ddbd 66 // Errors
dbrousse 0:129e8567ddbd 67 #define MX28_ERRBIT_NONE 0x00
dbrousse 0:129e8567ddbd 68 #define MX28_ERRBIT_VOLTAGE 0x01
dbrousse 0:129e8567ddbd 69 #define MX28_ERRBIT_ANGLE 0x02
dbrousse 0:129e8567ddbd 70 #define MX28_ERRBIT_OVERHEAT 0x04
dbrousse 0:129e8567ddbd 71 #define MX28_ERRBIT_RANGE 0x08
dbrousse 0:129e8567ddbd 72 #define MX28_ERRBIT_CHECKSUM 0x10
dbrousse 0:129e8567ddbd 73 #define MX28_ERRBIT_OVERLOAD 0x20
dbrousse 0:129e8567ddbd 74 #define MX28_ERRBIT_INSTRUCTION 0x40
dbrousse 0:129e8567ddbd 75
dbrousse 0:129e8567ddbd 76 // Extra errors
dbrousse 0:129e8567ddbd 77 #define MX28_ERRBIT_WRITE_TIMEOUT 0xFD
dbrousse 0:129e8567ddbd 78 #define MX28_ERRBIT_READ_TIMEOUT 0xFE
dbrousse 0:129e8567ddbd 79 #define MX28_ERRBIT_MASTER_CHECKSUM 0xFF
dbrousse 0:129e8567ddbd 80
dbrousse 0:129e8567ddbd 81 #define MX28_WAIT_AFTER_WRITE 1700 // Attention point de réglage délicat !!!
dbrousse 0:129e8567ddbd 82 // *** END "DO NOT MODIFY THESE CONSTANTS" SECTION ***