Dependencies: LCD_DISCO_F429ZI mbed BSP_DISCO_F429ZI
Tick/Tick.cpp@35:bda112796505, 2019-05-16 (annotated)
- Committer:
- ascheriit
- Date:
- Thu May 16 18:03:02 2019 +0000
- Revision:
- 35:bda112796505
- Child:
- 39:b069cf6be013
Cahier des charges complet !!!!!!!!!!!!
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ascheriit | 35:bda112796505 | 1 | #include "Tick.h" |
ascheriit | 35:bda112796505 | 2 | |
ascheriit | 35:bda112796505 | 3 | int GLOBAL_VALEUR_TICK; //Valeur facile d'accès à incrémanter grâce au ticker |
ascheriit | 35:bda112796505 | 4 | Ticker timer; // |
ascheriit | 35:bda112796505 | 5 | |
ascheriit | 35:bda112796505 | 6 | void T_incermment(){ |
ascheriit | 35:bda112796505 | 7 | GLOBAL_VALEUR_TICK++; |
ascheriit | 35:bda112796505 | 8 | } |
ascheriit | 35:bda112796505 | 9 | |
ascheriit | 35:bda112796505 | 10 | int T_checkValue(){ |
ascheriit | 35:bda112796505 | 11 | if(GLOBAL_VALEUR_TICK){ |
ascheriit | 35:bda112796505 | 12 | GLOBAL_VALEUR_TICK--; |
ascheriit | 35:bda112796505 | 13 | return 1; |
ascheriit | 35:bda112796505 | 14 | }else{ |
ascheriit | 35:bda112796505 | 15 | return 0; |
ascheriit | 35:bda112796505 | 16 | } |
ascheriit | 35:bda112796505 | 17 | } |
ascheriit | 35:bda112796505 | 18 | |
ascheriit | 35:bda112796505 | 19 | int* T_initialise(int tempsS){ |
ascheriit | 35:bda112796505 | 20 | int* ret=&GLOBAL_VALEUR_TICK; |
ascheriit | 35:bda112796505 | 21 | *ret=0; |
ascheriit | 35:bda112796505 | 22 | timer.attach(&T_incermment,tempsS); |
ascheriit | 35:bda112796505 | 23 | return ret; |
ascheriit | 35:bda112796505 | 24 | } |
ascheriit | 35:bda112796505 | 25 | |
ascheriit | 35:bda112796505 | 26 | void T_test(){ |
ascheriit | 35:bda112796505 | 27 | GLOBAL_VALEUR_TICK=0; |
ascheriit | 35:bda112796505 | 28 | timer.attach(&T_incermment,2); |
ascheriit | 35:bda112796505 | 29 | while(1){ |
ascheriit | 35:bda112796505 | 30 | BS_displayChiffre100Clean(35,25,GLOBAL_VALEUR_TICK,5,LCD_COLOR_RED,LCD_COLOR_WHITE); |
ascheriit | 35:bda112796505 | 31 | wait(0.1); |
ascheriit | 35:bda112796505 | 32 | } |
ascheriit | 35:bda112796505 | 33 | } |