Classes et code de la partie pompe du Robot 2021

Dependencies:   mbed ident_crac

Committer:
goldmas
Date:
Fri Jan 15 07:56:04 2021 +0000
Revision:
2:61ffa6e3eee5
Parent:
1:815ca6061e15
Child:
3:ac32a4abb2cc
Test commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
goldmas 0:253443d82cba 1 #include "bloc_8_pompe.h"
goldmas 0:253443d82cba 2
goldmas 0:253443d82cba 3 #define VENT_AT 0x266
goldmas 0:253443d82cba 4 #define VENT_RE 0x267
goldmas 0:253443d82cba 5
goldmas 0:253443d82cba 6 #define TEST_VENT_1_ON 0x268
goldmas 0:253443d82cba 7 #define TEST_VENT_1_OFF 0x269
goldmas 0:253443d82cba 8 #define VENT_ETAT 0x27A
goldmas 0:253443d82cba 9
goldmas 1:815ca6061e15 10 //initialisations relatives au Bus CAN
goldmas 1:815ca6061e15 11 CAN bus_CAN(PB_8, PB_9) ;
goldmas 1:815ca6061e15 12 int flag_reception_CAN = 0 ;
goldmas 2:61ffa6e3eee5 13 void interruption_reception(void) ;
goldmas 1:815ca6061e15 14
goldmas 0:253443d82cba 15 int main()
goldmas 0:253443d82cba 16 {
goldmas 0:253443d82cba 17 bloc_8_pompe::bloc_8_pompe classe_pompe (PC_9, PA_8, PB_0, //bloc 1
goldmas 0:253443d82cba 18 PA_9, PA_10, PB_1, //bloc 2
goldmas 0:253443d82cba 19 PA_11, PA_15, PC_1, //bloc 3
goldmas 0:253443d82cba 20 PB_7, PB_6, PC_0, //bloc 4
goldmas 0:253443d82cba 21 PC_7, PC_8, PC_5, //bloc 5
goldmas 0:253443d82cba 22 PB_10, PB_2, PC_4, //bloc 6
goldmas 0:253443d82cba 23 PA_6, PA_5, PA_7, //bloc 7
goldmas 0:253443d82cba 24 PA_0, PA_1, PA_4); //bloc 8
goldmas 0:253443d82cba 25
goldmas 0:253443d82cba 26 bool possession_gobelet[7] ;
goldmas 1:815ca6061e15 27
goldmas 2:61ffa6e3eee5 28 bus_CAN.attach(&interruption_reception()) ;
goldmas 0:253443d82cba 29
goldmas 0:253443d82cba 30 while(1)
goldmas 0:253443d82cba 31 {
goldmas 0:253443d82cba 32 for(int i=1 ; i<9 ; i++)
goldmas 0:253443d82cba 33 {
goldmas 0:253443d82cba 34 possession_gobelet[i-1] = classe_pompe.aspirer(i) ;
goldmas 0:253443d82cba 35 wait_ms(500) ;
goldmas 0:253443d82cba 36 if(possession_gobelet)
goldmas 0:253443d82cba 37 {
goldmas 0:253443d82cba 38 possession_gobelet[i-1] = classe_pompe.relacher(i) ;
goldmas 0:253443d82cba 39 wait_ms(100) ;
goldmas 0:253443d82cba 40 //detrompeur_possession = classe_pompe.possession(2) ;
goldmas 0:253443d82cba 41 }
goldmas 0:253443d82cba 42 //detrompeur_possession = classe_pompe.possession(2) ;
goldmas 0:253443d82cba 43 wait_ms(1000) ;
goldmas 0:253443d82cba 44 }
goldmas 0:253443d82cba 45
goldmas 0:253443d82cba 46 }
goldmas 0:253443d82cba 47
goldmas 0:253443d82cba 48 }