![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Classes et code de la partie pompe du Robot 2021
Dependencies: mbed ident_crac
main.cpp@9:6869e3869638, 2021-07-17 (annotated)
- Committer:
- goldmas
- Date:
- Sat Jul 17 11:09:18 2021 +0000
- Revision:
- 9:6869e3869638
- Parent:
- 8:ba95705cf7d4
Dernier code de la coupe de fracne 2021
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
goldmas | 0:253443d82cba | 1 | #include "bloc_8_pompe.h" |
goldmas | 0:253443d82cba | 2 | |
goldmas | 1:815ca6061e15 | 3 | //initialisations relatives au Bus CAN |
goldmas | 4:4bae30d48662 | 4 | CAN bus_CAN(PB_8, PB_9, 1000000) ; |
goldmas | 4:4bae30d48662 | 5 | CANMessage commande_carte ; |
goldmas | 6:b06c430a7e14 | 6 | CANMessage envoie ; |
goldmas | 1:815ca6061e15 | 7 | int flag_reception_CAN = 0 ; |
goldmas | 9:6869e3869638 | 8 | Timer scoreTimer; |
goldmas | 2:61ffa6e3eee5 | 9 | void interruption_reception(void) ; |
goldmas | 4:4bae30d48662 | 10 | void gestion_Message_CAN(void) ; |
goldmas | 9:6869e3869638 | 11 | void Envoi_msg_CAN(char donnee[6]); |
smarecar | 8:ba95705cf7d4 | 12 | void initialisation_CAN(void) ; |
goldmas | 9:6869e3869638 | 13 | void ventouse_etat(void); |
goldmas | 9:6869e3869638 | 14 | void SendRawId (unsigned short id); |
goldmas | 1:815ca6061e15 | 15 | |
goldmas | 4:4bae30d48662 | 16 | //Fin de jeu |
goldmas | 4:4bae30d48662 | 17 | char end_game = 0; |
goldmas | 4:4bae30d48662 | 18 | |
goldmas | 4:4bae30d48662 | 19 | bloc_8_pompe::bloc_8_pompe classe_pompe (PC_9, PA_8, PB_0, //bloc 1 |
goldmas | 9:6869e3869638 | 20 | PB_7, PA_10, PB_1, //bloc 2 |
goldmas | 9:6869e3869638 | 21 | PA_11, PA_15, PC_1, //bloc 3 |
goldmas | 9:6869e3869638 | 22 | PA_9, PB_6, PC_0, //bloc 4 |
goldmas | 9:6869e3869638 | 23 | PC_7, PC_8, PC_5, //bloc 5 |
goldmas | 9:6869e3869638 | 24 | PB_10, PB_2, PC_4, //bloc 6 |
goldmas | 9:6869e3869638 | 25 | PA_6, PA_5, PA_7, //bloc 7 |
goldmas | 9:6869e3869638 | 26 | PA_0, PA_1, PA_4); //bloc 8 |
goldmas | 4:4bae30d48662 | 27 | |
goldmas | 4:4bae30d48662 | 28 | int main() |
goldmas | 4:4bae30d48662 | 29 | { |
goldmas | 4:4bae30d48662 | 30 | bus_CAN.attach(&interruption_reception) ; |
goldmas | 9:6869e3869638 | 31 | static int old_Timer=0; |
goldmas | 9:6869e3869638 | 32 | initialisation_CAN() ; |
smarecar | 8:ba95705cf7d4 | 33 | |
goldmas | 9:6869e3869638 | 34 | scoreTimer.start(); |
smarecar | 8:ba95705cf7d4 | 35 | |
goldmas | 0:253443d82cba | 36 | while(1) |
goldmas | 0:253443d82cba | 37 | { |
goldmas | 9:6869e3869638 | 38 | //bus_CAN(envoie); |
goldmas | 9:6869e3869638 | 39 | if(flag_reception_CAN) |
goldmas | 9:6869e3869638 | 40 | { |
goldmas | 6:b06c430a7e14 | 41 | gestion_Message_CAN() ; |
goldmas | 6:b06c430a7e14 | 42 | } |
goldmas | 0:253443d82cba | 43 | |
goldmas | 6:b06c430a7e14 | 44 | if(end_game) |
goldmas | 6:b06c430a7e14 | 45 | { |
goldmas | 6:b06c430a7e14 | 46 | for (int i=0 ; i<8 ; i++) |
goldmas | 6:b06c430a7e14 | 47 | { |
goldmas | 6:b06c430a7e14 | 48 | classe_pompe.stop_pompe(i); |
goldmas | 6:b06c430a7e14 | 49 | wait_ms(10) ; |
goldmas | 6:b06c430a7e14 | 50 | } |
goldmas | 6:b06c430a7e14 | 51 | } |
goldmas | 9:6869e3869638 | 52 | |
goldmas | 9:6869e3869638 | 53 | ventouse_etat(); |
goldmas | 9:6869e3869638 | 54 | |
goldmas | 9:6869e3869638 | 55 | //Appelle toutes les 100ms pour regarder l'état des pompes |
goldmas | 9:6869e3869638 | 56 | /* |
goldmas | 9:6869e3869638 | 57 | if((scoreTimer.read_ms()-old_Timer)>=100) |
goldmas | 9:6869e3869638 | 58 | { |
goldmas | 9:6869e3869638 | 59 | ventouse_etat(); |
goldmas | 9:6869e3869638 | 60 | old_Timer=scoreTimer.read_ms(); |
goldmas | 9:6869e3869638 | 61 | } |
goldmas | 9:6869e3869638 | 62 | */ |
smarecar | 7:b7dc6201b520 | 63 | //Envoi_msg_CAN(1); //envoie un msg pour tester la liaison can |
goldmas | 0:253443d82cba | 64 | } |
goldmas | 0:253443d82cba | 65 | |
goldmas | 4:4bae30d48662 | 66 | } |
goldmas | 4:4bae30d48662 | 67 | |
goldmas | 4:4bae30d48662 | 68 | void interruption_reception(void) |
goldmas | 4:4bae30d48662 | 69 | { |
goldmas | 4:4bae30d48662 | 70 | if (bus_CAN.read(commande_carte)) |
goldmas | 4:4bae30d48662 | 71 | flag_reception_CAN = 1 ; |
goldmas | 4:4bae30d48662 | 72 | } |
goldmas | 4:4bae30d48662 | 73 | |
goldmas | 4:4bae30d48662 | 74 | void gestion_Message_CAN(void) |
goldmas | 4:4bae30d48662 | 75 | { |
goldmas | 4:4bae30d48662 | 76 | int identifiant = commande_carte.id ; |
goldmas | 4:4bae30d48662 | 77 | char num_groupe = 1 ; |
goldmas | 6:b06c430a7e14 | 78 | char etat_groupe = 0 ; |
goldmas | 4:4bae30d48662 | 79 | |
goldmas | 4:4bae30d48662 | 80 | switch (identifiant) |
goldmas | 4:4bae30d48662 | 81 | { |
goldmas | 4:4bae30d48662 | 82 | case VENT_AT: |
goldmas | 4:4bae30d48662 | 83 | num_groupe = commande_carte.data[0]; |
smarecar | 8:ba95705cf7d4 | 84 | if(num_groupe<6) |
smarecar | 8:ba95705cf7d4 | 85 | { |
smarecar | 8:ba95705cf7d4 | 86 | if(num_groupe == 0) num_groupe = 3; |
smarecar | 8:ba95705cf7d4 | 87 | else if (num_groupe == 1) num_groupe = 2; |
smarecar | 8:ba95705cf7d4 | 88 | else if (num_groupe == 2) num_groupe = 1; |
smarecar | 8:ba95705cf7d4 | 89 | else if (num_groupe == 3) num_groupe = 5; |
smarecar | 8:ba95705cf7d4 | 90 | else if (num_groupe == 4) num_groupe = 6; |
smarecar | 8:ba95705cf7d4 | 91 | else if (num_groupe == 5) num_groupe = 7; |
smarecar | 8:ba95705cf7d4 | 92 | classe_pompe.aspirer(num_groupe); |
smarecar | 8:ba95705cf7d4 | 93 | } |
smarecar | 8:ba95705cf7d4 | 94 | else if(num_groupe>5) |
smarecar | 8:ba95705cf7d4 | 95 | { |
smarecar | 8:ba95705cf7d4 | 96 | switch(num_groupe) |
smarecar | 8:ba95705cf7d4 | 97 | { |
smarecar | 8:ba95705cf7d4 | 98 | case 10: |
goldmas | 9:6869e3869638 | 99 | classe_pompe.aspirer(2); |
smarecar | 8:ba95705cf7d4 | 100 | classe_pompe.aspirer(3); |
smarecar | 8:ba95705cf7d4 | 101 | break; |
smarecar | 8:ba95705cf7d4 | 102 | |
smarecar | 8:ba95705cf7d4 | 103 | case 20: |
smarecar | 8:ba95705cf7d4 | 104 | classe_pompe.aspirer(1); |
smarecar | 8:ba95705cf7d4 | 105 | classe_pompe.aspirer(3); |
smarecar | 8:ba95705cf7d4 | 106 | break; |
smarecar | 8:ba95705cf7d4 | 107 | |
smarecar | 8:ba95705cf7d4 | 108 | case 21: |
smarecar | 8:ba95705cf7d4 | 109 | classe_pompe.aspirer(2); |
smarecar | 8:ba95705cf7d4 | 110 | classe_pompe.aspirer(1); |
smarecar | 8:ba95705cf7d4 | 111 | break; |
smarecar | 8:ba95705cf7d4 | 112 | |
smarecar | 8:ba95705cf7d4 | 113 | case 210: |
goldmas | 9:6869e3869638 | 114 | classe_pompe.aspirer(3); |
goldmas | 9:6869e3869638 | 115 | classe_pompe.aspirer(2); |
smarecar | 8:ba95705cf7d4 | 116 | classe_pompe.aspirer(1); |
smarecar | 8:ba95705cf7d4 | 117 | break; |
smarecar | 8:ba95705cf7d4 | 118 | |
smarecar | 8:ba95705cf7d4 | 119 | case 43: |
smarecar | 8:ba95705cf7d4 | 120 | classe_pompe.aspirer(5); |
smarecar | 8:ba95705cf7d4 | 121 | classe_pompe.aspirer(6); |
smarecar | 8:ba95705cf7d4 | 122 | break; |
smarecar | 8:ba95705cf7d4 | 123 | |
smarecar | 8:ba95705cf7d4 | 124 | case 53: |
smarecar | 8:ba95705cf7d4 | 125 | classe_pompe.aspirer(5); |
smarecar | 8:ba95705cf7d4 | 126 | classe_pompe.aspirer(7); |
smarecar | 8:ba95705cf7d4 | 127 | break; |
smarecar | 8:ba95705cf7d4 | 128 | |
smarecar | 8:ba95705cf7d4 | 129 | case 54: |
smarecar | 8:ba95705cf7d4 | 130 | classe_pompe.aspirer(7); |
smarecar | 8:ba95705cf7d4 | 131 | classe_pompe.aspirer(6); |
smarecar | 8:ba95705cf7d4 | 132 | break; |
smarecar | 8:ba95705cf7d4 | 133 | |
smarecar | 8:ba95705cf7d4 | 134 | case 66: |
smarecar | 8:ba95705cf7d4 | 135 | classe_pompe.aspirer(7); |
smarecar | 8:ba95705cf7d4 | 136 | classe_pompe.aspirer(6); |
smarecar | 8:ba95705cf7d4 | 137 | classe_pompe.aspirer(5); |
smarecar | 8:ba95705cf7d4 | 138 | break; |
smarecar | 8:ba95705cf7d4 | 139 | } |
smarecar | 8:ba95705cf7d4 | 140 | } |
goldmas | 4:4bae30d48662 | 141 | break; |
goldmas | 4:4bae30d48662 | 142 | |
goldmas | 4:4bae30d48662 | 143 | case VENT_RE: |
goldmas | 4:4bae30d48662 | 144 | num_groupe = commande_carte.data[0]; |
smarecar | 8:ba95705cf7d4 | 145 | if(num_groupe<6) |
smarecar | 8:ba95705cf7d4 | 146 | { |
smarecar | 8:ba95705cf7d4 | 147 | if(num_groupe == 0) num_groupe = 3; |
smarecar | 8:ba95705cf7d4 | 148 | else if (num_groupe == 1) num_groupe = 2; |
smarecar | 8:ba95705cf7d4 | 149 | else if (num_groupe == 2) num_groupe = 1; |
smarecar | 8:ba95705cf7d4 | 150 | else if (num_groupe == 3) num_groupe = 5; |
smarecar | 8:ba95705cf7d4 | 151 | else if (num_groupe == 4) num_groupe = 6; |
smarecar | 8:ba95705cf7d4 | 152 | else if (num_groupe == 5) num_groupe = 7; |
smarecar | 8:ba95705cf7d4 | 153 | classe_pompe.relacher(num_groupe); |
smarecar | 8:ba95705cf7d4 | 154 | } |
smarecar | 8:ba95705cf7d4 | 155 | else if(num_groupe>5) |
smarecar | 8:ba95705cf7d4 | 156 | { |
smarecar | 8:ba95705cf7d4 | 157 | switch(num_groupe) |
smarecar | 8:ba95705cf7d4 | 158 | { |
smarecar | 8:ba95705cf7d4 | 159 | case 10: |
smarecar | 8:ba95705cf7d4 | 160 | classe_pompe.relacher(2); |
goldmas | 9:6869e3869638 | 161 | classe_pompe.relacher(3); |
smarecar | 8:ba95705cf7d4 | 162 | break; |
smarecar | 8:ba95705cf7d4 | 163 | |
smarecar | 8:ba95705cf7d4 | 164 | case 20: |
smarecar | 8:ba95705cf7d4 | 165 | classe_pompe.relacher(1); |
smarecar | 8:ba95705cf7d4 | 166 | classe_pompe.relacher(3); |
smarecar | 8:ba95705cf7d4 | 167 | break; |
smarecar | 8:ba95705cf7d4 | 168 | |
smarecar | 8:ba95705cf7d4 | 169 | case 21: |
smarecar | 8:ba95705cf7d4 | 170 | classe_pompe.relacher(2); |
smarecar | 8:ba95705cf7d4 | 171 | classe_pompe.relacher(1); |
smarecar | 8:ba95705cf7d4 | 172 | break; |
smarecar | 8:ba95705cf7d4 | 173 | |
smarecar | 8:ba95705cf7d4 | 174 | case 210: |
smarecar | 8:ba95705cf7d4 | 175 | classe_pompe.relacher(3); |
smarecar | 8:ba95705cf7d4 | 176 | classe_pompe.relacher(2); |
smarecar | 8:ba95705cf7d4 | 177 | classe_pompe.relacher(1); |
smarecar | 8:ba95705cf7d4 | 178 | break; |
smarecar | 8:ba95705cf7d4 | 179 | |
smarecar | 8:ba95705cf7d4 | 180 | case 43: |
smarecar | 8:ba95705cf7d4 | 181 | classe_pompe.relacher(5); |
smarecar | 8:ba95705cf7d4 | 182 | classe_pompe.relacher(6); |
smarecar | 8:ba95705cf7d4 | 183 | break; |
smarecar | 8:ba95705cf7d4 | 184 | |
smarecar | 8:ba95705cf7d4 | 185 | case 53: |
smarecar | 8:ba95705cf7d4 | 186 | classe_pompe.relacher(7); |
smarecar | 8:ba95705cf7d4 | 187 | classe_pompe.relacher(5); |
smarecar | 8:ba95705cf7d4 | 188 | break; |
smarecar | 8:ba95705cf7d4 | 189 | |
smarecar | 8:ba95705cf7d4 | 190 | case 54: |
smarecar | 8:ba95705cf7d4 | 191 | classe_pompe.relacher(7); |
smarecar | 8:ba95705cf7d4 | 192 | classe_pompe.relacher(6); |
smarecar | 8:ba95705cf7d4 | 193 | break; |
smarecar | 8:ba95705cf7d4 | 194 | |
smarecar | 8:ba95705cf7d4 | 195 | case 66: |
smarecar | 8:ba95705cf7d4 | 196 | classe_pompe.relacher(7); |
smarecar | 8:ba95705cf7d4 | 197 | classe_pompe.relacher(6); |
smarecar | 8:ba95705cf7d4 | 198 | classe_pompe.relacher(5); |
smarecar | 8:ba95705cf7d4 | 199 | break; |
smarecar | 8:ba95705cf7d4 | 200 | } |
smarecar | 8:ba95705cf7d4 | 201 | } |
goldmas | 4:4bae30d48662 | 202 | break; |
goldmas | 4:4bae30d48662 | 203 | |
goldmas | 4:4bae30d48662 | 204 | case VENT_ETAT: |
goldmas | 6:b06c430a7e14 | 205 | num_groupe = commande_carte.data[0]; |
goldmas | 9:6869e3869638 | 206 | if(num_groupe<6) |
goldmas | 9:6869e3869638 | 207 | { |
goldmas | 9:6869e3869638 | 208 | if(num_groupe == 0) num_groupe = 3; |
goldmas | 9:6869e3869638 | 209 | else if (num_groupe == 1) num_groupe = 2; |
goldmas | 9:6869e3869638 | 210 | else if (num_groupe == 2) num_groupe = 1; |
goldmas | 9:6869e3869638 | 211 | else if (num_groupe == 3) num_groupe = 5; |
goldmas | 9:6869e3869638 | 212 | else if (num_groupe == 4) num_groupe = 6; |
goldmas | 9:6869e3869638 | 213 | else if (num_groupe == 5) num_groupe = 7; |
goldmas | 9:6869e3869638 | 214 | } |
goldmas | 6:b06c430a7e14 | 215 | etat_groupe = classe_pompe.etat_actuel(num_groupe) ; |
goldmas | 6:b06c430a7e14 | 216 | |
goldmas | 6:b06c430a7e14 | 217 | if(etat_groupe == 0x07) |
goldmas | 6:b06c430a7e14 | 218 | { |
goldmas | 6:b06c430a7e14 | 219 | classe_pompe.aspirer(num_groupe) ; |
goldmas | 6:b06c430a7e14 | 220 | etat_groupe = classe_pompe.etat_actuel(num_groupe) ; |
goldmas | 6:b06c430a7e14 | 221 | } |
goldmas | 6:b06c430a7e14 | 222 | |
goldmas | 6:b06c430a7e14 | 223 | |
goldmas | 9:6869e3869638 | 224 | //Envoi_msg_CAN(etat_groupe); |
goldmas | 6:b06c430a7e14 | 225 | |
goldmas | 4:4bae30d48662 | 226 | break; |
goldmas | 4:4bae30d48662 | 227 | |
goldmas | 4:4bae30d48662 | 228 | case GLOBAL_GAME_END: |
goldmas | 4:4bae30d48662 | 229 | end_game = 1; |
goldmas | 6:b06c430a7e14 | 230 | break; |
goldmas | 4:4bae30d48662 | 231 | |
goldmas | 6:b06c430a7e14 | 232 | |
goldmas | 4:4bae30d48662 | 233 | /* |
goldmas | 4:4bae30d48662 | 234 | |
goldmas | 4:4bae30d48662 | 235 | case TEST_VENT_1_ON: |
goldmas | 4:4bae30d48662 | 236 | classe_pompe[AV_DROIT]->action(1); |
goldmas | 4:4bae30d48662 | 237 | classe_pompe[AV_CENTRE]->action(1); |
goldmas | 4:4bae30d48662 | 238 | classe_pompe[AV_GAUCHE]->action(1); |
goldmas | 4:4bae30d48662 | 239 | classe_pompe[AR_DROIT]->action(1); |
goldmas | 4:4bae30d48662 | 240 | classe_pompe[AR_CENTRE]->action(1); |
goldmas | 4:4bae30d48662 | 241 | classe_pompe[AR_GAUCHE]->action(1); |
goldmas | 4:4bae30d48662 | 242 | break; |
goldmas | 4:4bae30d48662 | 243 | |
goldmas | 4:4bae30d48662 | 244 | case TEST_VENT_1_OFF: |
goldmas | 4:4bae30d48662 | 245 | classe_pompe[AV_CENTRE]->action(0); |
goldmas | 4:4bae30d48662 | 246 | classe_pompe[AV_GAUCHE]->action(0); |
goldmas | 4:4bae30d48662 | 247 | classe_pompe[AR_DROIT]->action(0); |
goldmas | 4:4bae30d48662 | 248 | classe_pompe[AR_CENTRE]->action(0); |
goldmas | 4:4bae30d48662 | 249 | classe_pompe[AR_GAUCHE]->action(0); |
goldmas | 4:4bae30d48662 | 250 | classe_pompe[AV_DROIT]->action(0); |
goldmas | 4:4bae30d48662 | 251 | break;*/ |
goldmas | 4:4bae30d48662 | 252 | default: |
goldmas | 4:4bae30d48662 | 253 | break; |
goldmas | 6:b06c430a7e14 | 254 | } |
goldmas | 6:b06c430a7e14 | 255 | flag_reception_CAN = 0 ; |
goldmas | 4:4bae30d48662 | 256 | |
goldmas | 4:4bae30d48662 | 257 | } |
goldmas | 4:4bae30d48662 | 258 | |
goldmas | 9:6869e3869638 | 259 | void Envoi_msg_CAN(char donnee[6]) |
goldmas | 4:4bae30d48662 | 260 | { |
goldmas | 9:6869e3869638 | 261 | CANMessage etat_ventouses=CANMessage(); |
goldmas | 6:b06c430a7e14 | 262 | etat_ventouses.id = 0x220; |
goldmas | 9:6869e3869638 | 263 | etat_ventouses.len=6; |
goldmas | 4:4bae30d48662 | 264 | etat_ventouses.type=CANData; |
goldmas | 9:6869e3869638 | 265 | for(int num_octet=0; num_octet<6; num_octet++) |
goldmas | 9:6869e3869638 | 266 | { |
goldmas | 9:6869e3869638 | 267 | etat_ventouses.data[num_octet]=donnee[num_octet]; |
goldmas | 9:6869e3869638 | 268 | } |
goldmas | 6:b06c430a7e14 | 269 | bus_CAN.write(etat_ventouses); |
smarecar | 8:ba95705cf7d4 | 270 | } |
smarecar | 8:ba95705cf7d4 | 271 | |
smarecar | 8:ba95705cf7d4 | 272 | void initialisation_CAN(void) |
smarecar | 8:ba95705cf7d4 | 273 | { |
smarecar | 8:ba95705cf7d4 | 274 | CANMessage msg_init; |
smarecar | 8:ba95705cf7d4 | 275 | msg_init.id = ALIVE_ACTIONNEURS_ARRIERE; |
smarecar | 8:ba95705cf7d4 | 276 | msg_init.len=0; |
smarecar | 8:ba95705cf7d4 | 277 | |
smarecar | 8:ba95705cf7d4 | 278 | bus_CAN.write(msg_init); |
goldmas | 9:6869e3869638 | 279 | } |
goldmas | 9:6869e3869638 | 280 | |
goldmas | 9:6869e3869638 | 281 | void ventouse_etat(void) |
goldmas | 9:6869e3869638 | 282 | { |
goldmas | 9:6869e3869638 | 283 | char num_groupe; |
goldmas | 9:6869e3869638 | 284 | char etat_groupe[6]; |
goldmas | 9:6869e3869638 | 285 | static char old_etat_groupe[6] = {0,0,0,0,0,0}; |
goldmas | 9:6869e3869638 | 286 | |
goldmas | 9:6869e3869638 | 287 | for(int i=0;i<6;i++) |
goldmas | 9:6869e3869638 | 288 | { |
goldmas | 9:6869e3869638 | 289 | if(i == 0) num_groupe = 3; |
goldmas | 9:6869e3869638 | 290 | else if (i == 1) num_groupe = 2; |
goldmas | 9:6869e3869638 | 291 | else if (i == 2) num_groupe = 1; |
goldmas | 9:6869e3869638 | 292 | else if (i == 3) num_groupe = 5; |
goldmas | 9:6869e3869638 | 293 | else if (i == 4) num_groupe = 6; |
goldmas | 9:6869e3869638 | 294 | else if (i == 5) num_groupe = 7; |
goldmas | 9:6869e3869638 | 295 | |
goldmas | 9:6869e3869638 | 296 | etat_groupe[i] = classe_pompe.etat_actuel(num_groupe); |
goldmas | 9:6869e3869638 | 297 | } |
goldmas | 9:6869e3869638 | 298 | |
goldmas | 9:6869e3869638 | 299 | for(int i=0;i<6;i++) |
goldmas | 9:6869e3869638 | 300 | { |
goldmas | 9:6869e3869638 | 301 | if(old_etat_groupe[i] != etat_groupe[i]) |
goldmas | 9:6869e3869638 | 302 | { |
goldmas | 9:6869e3869638 | 303 | Envoi_msg_CAN(etat_groupe); |
goldmas | 9:6869e3869638 | 304 | } |
goldmas | 9:6869e3869638 | 305 | old_etat_groupe[i] = etat_groupe[i]; |
goldmas | 9:6869e3869638 | 306 | } |
goldmas | 9:6869e3869638 | 307 | } |
goldmas | 9:6869e3869638 | 308 | |
goldmas | 9:6869e3869638 | 309 | |
goldmas | 9:6869e3869638 | 310 | void SendRawId (unsigned short id) |
goldmas | 9:6869e3869638 | 311 | { |
goldmas | 9:6869e3869638 | 312 | CANMessage msgTx; |
goldmas | 9:6869e3869638 | 313 | msgTx.id=id; |
goldmas | 9:6869e3869638 | 314 | msgTx.len=0; |
goldmas | 9:6869e3869638 | 315 | bus_CAN.write(msgTx); |
goldmas | 9:6869e3869638 | 316 | } |