carte esclave Petit Robot
Dependencies: mbed Herkulex_Library_2019 actions_Gr ident_crac actions_Pr
Actionneurs/herkulex_rob.cpp@42:a7300d563596, 2019-05-25 (annotated)
- Committer:
- marwanesaich
- Date:
- Sat May 25 00:59:11 2019 +0000
- Revision:
- 42:a7300d563596
- Parent:
- 26:4a3467da3243
- Child:
- 45:3cb347342a0d
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kyxstark | 25:9627700d989f | 1 | |
kyxstark | 23:93a427b242ce | 2 | #include "herkulex_rob.h" |
kyxstark | 23:93a427b242ce | 3 | |
kyxstark | 23:93a427b242ce | 4 | |
kyxstark | 23:93a427b242ce | 5 | //---------------------------------------Petit robot--------------------------------------------------------- |
kyxstark | 23:93a427b242ce | 6 | /*void gros_robot_init(void) |
kyxstark | 23:93a427b242ce | 7 | { |
kyxstark | 23:93a427b242ce | 8 | void palet_accelerateur(){ |
kyxstark | 23:93a427b242ce | 9 | compteTour(ID,1000,1,1,PLED_ON,serialbarillet); |
kyxstark | 23:93a427b242ce | 10 | } |
kyxstark | 23:93a427b242ce | 11 | void palet_balance(){ |
kyxstark | 23:93a427b242ce | 12 | compteTour(ID,-1000,1,1,PLED_ON,serialbarillet); |
kyxstark | 23:93a427b242ce | 13 | } |
kyxstark | 23:93a427b242ce | 14 | void sortie_balance() |
kyxstark | 23:93a427b242ce | 15 | { |
kyxstark | 23:93a427b242ce | 16 | |
kyxstark | 23:93a427b242ce | 17 | } |
kyxstark | 23:93a427b242ce | 18 | |
kyxstark | 23:93a427b242ce | 19 | */ |
kyxstark | 23:93a427b242ce | 20 | |
kyxstark | 23:93a427b242ce | 21 | |
kyxstark | 23:93a427b242ce | 22 | #ifdef ROBOT_SMALL |
kyxstark | 23:93a427b242ce | 23 | //--------------------------------------------------------------------------------------------- |
kyxstark | 23:93a427b242ce | 24 | void deverouillage_torque (void) //débloquer les servomoteurs |
kyxstark | 23:93a427b242ce | 25 | { |
kyxstark | 23:93a427b242ce | 26 | deverouillage_torque_avant(); |
kyxstark | 23:93a427b242ce | 27 | deverouillage_torque_arriere(); |
kyxstark | 23:93a427b242ce | 28 | deverouillage_torque_sol(); |
kyxstark | 23:93a427b242ce | 29 | } |
kyxstark | 23:93a427b242ce | 30 | void deverouillage_torque_avant (void) |
kyxstark | 23:93a427b242ce | 31 | { |
kyxstark | 23:93a427b242ce | 32 | clear(AV_EP_G, 3); |
kyxstark | 23:93a427b242ce | 33 | clear(AV_poigne_G,3); |
kyxstark | 23:93a427b242ce | 34 | clear(AV_EP_C, 2); |
kyxstark | 23:93a427b242ce | 35 | clear(AV_poigne_C, 2); |
kyxstark | 23:93a427b242ce | 36 | clear(AV_EP_D, 1); |
kyxstark | 23:93a427b242ce | 37 | clear(AV_poigne_D,1); |
kyxstark | 23:93a427b242ce | 38 | |
kyxstark | 23:93a427b242ce | 39 | setTorque(AV_EP_G, TORQUE_ON,3); |
kyxstark | 23:93a427b242ce | 40 | setTorque(AV_poigne_G, TORQUE_ON,3); |
kyxstark | 23:93a427b242ce | 41 | setTorque(AV_EP_C, TORQUE_ON,2); |
kyxstark | 23:93a427b242ce | 42 | setTorque(AV_poigne_C, TORQUE_ON,2); |
kyxstark | 23:93a427b242ce | 43 | setTorque(AV_EP_D, TORQUE_ON,1); |
kyxstark | 23:93a427b242ce | 44 | setTorque(AV_poigne_D, TORQUE_ON,1); |
kyxstark | 23:93a427b242ce | 45 | } |
kyxstark | 23:93a427b242ce | 46 | |
kyxstark | 23:93a427b242ce | 47 | void deverouillage_torque_arriere (void) |
kyxstark | 23:93a427b242ce | 48 | { |
kyxstark | 23:93a427b242ce | 49 | clear(AR_EP_G, 3); |
kyxstark | 23:93a427b242ce | 50 | clear(AR_poigne_G,3); |
kyxstark | 23:93a427b242ce | 51 | clear(AR_EP_C, 2); |
kyxstark | 23:93a427b242ce | 52 | clear(AR_poigne_C, 2); |
kyxstark | 23:93a427b242ce | 53 | clear(AR_EP_D, 1); |
kyxstark | 23:93a427b242ce | 54 | clear(AR_poigne_D,1); |
kyxstark | 23:93a427b242ce | 55 | |
kyxstark | 23:93a427b242ce | 56 | setTorque(AR_EP_G, TORQUE_ON,1); |
kyxstark | 23:93a427b242ce | 57 | setTorque(AR_poigne_G, TORQUE_ON,1); |
kyxstark | 23:93a427b242ce | 58 | setTorque(AR_EP_C, TORQUE_ON,2); |
kyxstark | 23:93a427b242ce | 59 | setTorque(AR_poigne_C, TORQUE_ON,2); |
kyxstark | 23:93a427b242ce | 60 | setTorque(AR_EP_D, TORQUE_ON,3); |
kyxstark | 23:93a427b242ce | 61 | setTorque(AR_poigne_D, TORQUE_ON,3); |
kyxstark | 23:93a427b242ce | 62 | } |
kyxstark | 23:93a427b242ce | 63 | |
kyxstark | 23:93a427b242ce | 64 | |
kyxstark | 23:93a427b242ce | 65 | void deverouillage_torque_sol (void) |
kyxstark | 23:93a427b242ce | 66 | { |
kyxstark | 23:93a427b242ce | 67 | |
kyxstark | 23:93a427b242ce | 68 | clear(AR_sol,4); |
kyxstark | 23:93a427b242ce | 69 | clear(AV_sol,4); |
kyxstark | 23:93a427b242ce | 70 | |
kyxstark | 23:93a427b242ce | 71 | setTorque(AR_sol, TORQUE_ON,4); |
kyxstark | 23:93a427b242ce | 72 | setTorque(AV_sol, TORQUE_ON,4); |
kyxstark | 23:93a427b242ce | 73 | |
kyxstark | 23:93a427b242ce | 74 | } |
kyxstark | 23:93a427b242ce | 75 | |
kyxstark | 23:93a427b242ce | 76 | #endif |
kyxstark | 23:93a427b242ce | 77 | |
kyxstark | 23:93a427b242ce | 78 | #ifdef ROBOT_BIG |
kyxstark | 23:93a427b242ce | 79 | |
kyxstark | 23:93a427b242ce | 80 | void deverouillage_torque (void) //débloquer les servomoteurs |
kyxstark | 23:93a427b242ce | 81 | { |
kyxstark | 23:93a427b242ce | 82 | deverouillage_torque_bras(); |
kyxstark | 23:93a427b242ce | 83 | deverouillage_torque_convoyeurs(); |
kyxstark | 26:4a3467da3243 | 84 | deverouillage_torque_doigt(); |
kyxstark | 23:93a427b242ce | 85 | deverouillage_torque_roues(); |
kyxstark | 23:93a427b242ce | 86 | } |
kyxstark | 23:93a427b242ce | 87 | |
kyxstark | 23:93a427b242ce | 88 | |
kyxstark | 23:93a427b242ce | 89 | void deverouillage_torque_bras(void) |
kyxstark | 23:93a427b242ce | 90 | { |
kyxstark | 23:93a427b242ce | 91 | clear(AV_EP_C,2); |
kyxstark | 23:93a427b242ce | 92 | clear(AV_poigne_C,2); |
kyxstark | 23:93a427b242ce | 93 | |
kyxstark | 23:93a427b242ce | 94 | setTorque(AV_EP_C, TORQUE_ON,2); |
kyxstark | 23:93a427b242ce | 95 | setTorque(AV_poigne_C, TORQUE_ON,2); |
kyxstark | 23:93a427b242ce | 96 | } |
kyxstark | 23:93a427b242ce | 97 | |
kyxstark | 23:93a427b242ce | 98 | void deverouillage_torque_convoyeurs(void) |
kyxstark | 23:93a427b242ce | 99 | { |
kyxstark | 23:93a427b242ce | 100 | clear(stockage_D,3); |
kyxstark | 23:93a427b242ce | 101 | clear(stockage_G,1); |
kyxstark | 23:93a427b242ce | 102 | |
kyxstark | 23:93a427b242ce | 103 | setTorque(stockage_D, TORQUE_ON,3); |
kyxstark | 23:93a427b242ce | 104 | setTorque(stockage_G, TORQUE_ON,1); |
kyxstark | 23:93a427b242ce | 105 | } |
marwanesaich | 42:a7300d563596 | 106 | void deverouillage_torque_convoyeurs_gauche(void) |
marwanesaich | 42:a7300d563596 | 107 | { |
marwanesaich | 42:a7300d563596 | 108 | clear(stockage_G,1); |
marwanesaich | 42:a7300d563596 | 109 | |
marwanesaich | 42:a7300d563596 | 110 | setTorque(stockage_G, TORQUE_ON,1); |
marwanesaich | 42:a7300d563596 | 111 | } |
marwanesaich | 42:a7300d563596 | 112 | void deverouillage_torque_convoyeurs_droit(void) |
marwanesaich | 42:a7300d563596 | 113 | { |
marwanesaich | 42:a7300d563596 | 114 | clear(stockage_D,3); |
marwanesaich | 42:a7300d563596 | 115 | |
marwanesaich | 42:a7300d563596 | 116 | setTorque(stockage_D, TORQUE_ON,3); |
marwanesaich | 42:a7300d563596 | 117 | } |
kyxstark | 23:93a427b242ce | 118 | |
kyxstark | 23:93a427b242ce | 119 | void deverouillage_torque_roues(void) |
kyxstark | 23:93a427b242ce | 120 | { |
kyxstark | 23:93a427b242ce | 121 | clear(roue_D,3); |
kyxstark | 23:93a427b242ce | 122 | clear(roue_G,1); |
kyxstark | 23:93a427b242ce | 123 | |
kyxstark | 23:93a427b242ce | 124 | setTorque(roue_D, TORQUE_ON,3); |
kyxstark | 23:93a427b242ce | 125 | setTorque(roue_G, TORQUE_ON,1); |
kyxstark | 23:93a427b242ce | 126 | } |
kyxstark | 23:93a427b242ce | 127 | |
kyxstark | 23:93a427b242ce | 128 | |
kyxstark | 23:93a427b242ce | 129 | void deverouillage_torque_doigt(void) |
kyxstark | 23:93a427b242ce | 130 | { |
kyxstark | 23:93a427b242ce | 131 | clear(doigt,2); |
kyxstark | 23:93a427b242ce | 132 | setTorque(doigt, TORQUE_ON,2); |
kyxstark | 23:93a427b242ce | 133 | } |
kyxstark | 23:93a427b242ce | 134 | |
kyxstark | 23:93a427b242ce | 135 | #endif |