Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp@6:a16c0a024fd5, 2017-09-19 (annotated)
- Committer:
- kkalsi
- Date:
- Tue Sep 19 17:55:20 2017 +0000
- Revision:
- 6:a16c0a024fd5
- Parent:
- 5:85cbea9f3eb7
another last version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vincentlabbe | 0:0fb169e1b9b4 | 1 | #include "mbed.h" |
kkalsi | 3:637374dbfc6d | 2 | #include "rtos.h" |
kkalsi | 3:637374dbfc6d | 3 | |
kkalsi | 5:85cbea9f3eb7 | 4 | //Serial pc(USBTX, USBRX); // tx, rx |
kkalsi | 3:637374dbfc6d | 5 | DigitalIn en_1(p15); |
kkalsi | 3:637374dbfc6d | 6 | DigitalIn en_2(p16); |
kkalsi | 3:637374dbfc6d | 7 | AnalogIn ea_1(p19); |
kkalsi | 3:637374dbfc6d | 8 | AnalogIn ea_2(p20); |
kkalsi | 3:637374dbfc6d | 9 | |
kkalsi | 5:85cbea9f3eb7 | 10 | // pout vérification d'échantionnage avec oscilloscope |
kkalsi | 5:85cbea9f3eb7 | 11 | DigitalOut sn_test(p18); |
kkalsi | 5:85cbea9f3eb7 | 12 | |
kkalsi | 5:85cbea9f3eb7 | 13 | #define POTENTIOMETRE 1 |
kkalsi | 5:85cbea9f3eb7 | 14 | #define BOUTON 0 |
kkalsi | 5:85cbea9f3eb7 | 15 | #define SIGNAL_ANALOG 0x2 |
kkalsi | 5:85cbea9f3eb7 | 16 | #define SIGNAL_NUM 0x1 |
kkalsi | 5:85cbea9f3eb7 | 17 | |
kkalsi | 3:637374dbfc6d | 18 | Ticker sample; |
kkalsi | 3:637374dbfc6d | 19 | |
kkalsi | 3:637374dbfc6d | 20 | // variable globale pour lecture button 1 |
kkalsi | 3:637374dbfc6d | 21 | int previousStateButton1 = 0; |
kkalsi | 3:637374dbfc6d | 22 | int currentStateButton1; |
kkalsi | 3:637374dbfc6d | 23 | int validationStateButton1; |
kkalsi | 3:637374dbfc6d | 24 | |
kkalsi | 3:637374dbfc6d | 25 | // variable globale pour lecture button 2 |
kkalsi | 3:637374dbfc6d | 26 | int previousStateButton2 = 0; |
kkalsi | 3:637374dbfc6d | 27 | int currentStateButton2; |
kkalsi | 3:637374dbfc6d | 28 | int validationStateButton2; |
vincentlabbe | 0:0fb169e1b9b4 | 29 | |
kkalsi | 3:637374dbfc6d | 30 | // variable globale pour lecture potentiometre |
kkalsi | 3:637374dbfc6d | 31 | int tab_counter =0; |
kkalsi | 3:637374dbfc6d | 32 | int Nouvelle_moyenne_p19; |
kkalsi | 3:637374dbfc6d | 33 | int Ancienne_moyenne_p19 = 0; |
kkalsi | 3:637374dbfc6d | 34 | int Nouvelle_moyenne_p20; |
kkalsi | 3:637374dbfc6d | 35 | int Ancienne_moyenne_p20 = 0; |
kkalsi | 3:637374dbfc6d | 36 | unsigned short Tableau_Moyenne_p19[5]={0,0,0,0,0}; |
kkalsi | 3:637374dbfc6d | 37 | unsigned short Tableau_Moyenne_p20[5]={0,0,0,0,0}; |
kkalsi | 3:637374dbfc6d | 38 | |
kkalsi | 3:637374dbfc6d | 39 | int ISRcounter = 0; |
kkalsi | 3:637374dbfc6d | 40 | |
kkalsi | 3:637374dbfc6d | 41 | Thread *threadNumerique; // pointeur vers le thread du lecture numérique |
kkalsi | 3:637374dbfc6d | 42 | Thread *threadAnalogique; // pointeur vers le thread du lecture analogique |
kkalsi | 4:877b4e9cad76 | 43 | Thread *threadCollection; // pointeur vers le thread d'affichage d'evenement |
kkalsi | 4:877b4e9cad76 | 44 | |
kkalsi | 4:877b4e9cad76 | 45 | // Pour le time stamp |
kkalsi | 4:877b4e9cad76 | 46 | char buffer[32]; |
kkalsi | 6:a16c0a024fd5 | 47 | struct tm * timeinfo; |
kkalsi | 4:877b4e9cad76 | 48 | |
kkalsi | 4:877b4e9cad76 | 49 | // structure de data |
kkalsi | 4:877b4e9cad76 | 50 | typedef struct { |
kkalsi | 4:877b4e9cad76 | 51 | time_t seconds; |
kkalsi | 4:877b4e9cad76 | 52 | int pinNumero; |
kkalsi | 5:85cbea9f3eb7 | 53 | int info; |
kkalsi | 5:85cbea9f3eb7 | 54 | bool type; // |
kkalsi | 4:877b4e9cad76 | 55 | } data; |
kkalsi | 4:877b4e9cad76 | 56 | |
kkalsi | 4:877b4e9cad76 | 57 | // Create queue |
kkalsi | 4:877b4e9cad76 | 58 | Queue<data, 32> queue; |
kkalsi | 4:877b4e9cad76 | 59 | |
kkalsi | 4:877b4e9cad76 | 60 | // Create memory pool |
kkalsi | 4:877b4e9cad76 | 61 | MemoryPool<data, 32> mpool; |
kkalsi | 4:877b4e9cad76 | 62 | |
kkalsi | 4:877b4e9cad76 | 63 | // osEvent to get from queue |
kkalsi | 4:877b4e9cad76 | 64 | osEvent evt; |
vincentlabbe | 1:a18a07e03e7d | 65 | |
kkalsi | 3:637374dbfc6d | 66 | // Thread pour lecture analogique |
kkalsi | 3:637374dbfc6d | 67 | void lecture_analog(void const *args) { |
kkalsi | 5:85cbea9f3eb7 | 68 | //int counterRTC = 0; |
kkalsi | 3:637374dbfc6d | 69 | while (true) |
kkalsi | 3:637374dbfc6d | 70 | { |
kkalsi | 5:85cbea9f3eb7 | 71 | Thread::signal_wait(SIGNAL_ANALOG); // WAITING STATE (waiting for an event) |
kkalsi | 5:85cbea9f3eb7 | 72 | /* |
kkalsi | 5:85cbea9f3eb7 | 73 | if(counterRTC == 500) |
kkalsi | 5:85cbea9f3eb7 | 74 | { |
kkalsi | 5:85cbea9f3eb7 | 75 | time_t seconds = time(NULL); |
kkalsi | 5:85cbea9f3eb7 | 76 | printf("\n\r"); |
kkalsi | 5:85cbea9f3eb7 | 77 | printf("valider les frequences dechantillonnage pour analogique \n\r"); |
kkalsi | 5:85cbea9f3eb7 | 78 | printf("Nombre de secondes passer pour 500 iterations = %d\n\r", seconds); |
kkalsi | 5:85cbea9f3eb7 | 79 | printf("Secondes/iterations = %f\n\r", ((float)seconds/500)); |
kkalsi | 5:85cbea9f3eb7 | 80 | } |
kkalsi | 5:85cbea9f3eb7 | 81 | counterRTC++; |
kkalsi | 5:85cbea9f3eb7 | 82 | */ |
kkalsi | 4:877b4e9cad76 | 83 | // create data structure |
kkalsi | 4:877b4e9cad76 | 84 | data *analogData; |
kkalsi | 4:877b4e9cad76 | 85 | |
kkalsi | 3:637374dbfc6d | 86 | Tableau_Moyenne_p19[tab_counter] = ea_1.read_u16(); //= LIRE PATTE 8 ; |
kkalsi | 3:637374dbfc6d | 87 | Tableau_Moyenne_p20[tab_counter] = ea_2.read_u16(); //= LIRE PATTE 8 ; |
kkalsi | 3:637374dbfc6d | 88 | |
kkalsi | 3:637374dbfc6d | 89 | if(tab_counter % 5 == 0) // validation duree de 1.25 seconde sont terminée |
kkalsi | 3:637374dbfc6d | 90 | { |
kkalsi | 3:637374dbfc6d | 91 | Nouvelle_moyenne_p19 = (int)Tableau_Moyenne_p19[0]+(int)Tableau_Moyenne_p19[1]+(int)Tableau_Moyenne_p19[2]+(int)Tableau_Moyenne_p19[3]+(int)Tableau_Moyenne_p19[4]; |
kkalsi | 3:637374dbfc6d | 92 | Nouvelle_moyenne_p20 = (int)Tableau_Moyenne_p20[0]+(int)Tableau_Moyenne_p20[1]+(int)Tableau_Moyenne_p20[2]+(int)Tableau_Moyenne_p20[3]+(int)Tableau_Moyenne_p20[4]; |
kkalsi | 3:637374dbfc6d | 93 | } |
vincentlabbe | 1:a18a07e03e7d | 94 | |
kkalsi | 5:85cbea9f3eb7 | 95 | // vérification de la difference de la moyenne de 12.5% pour les 2 potentiometres |
kkalsi | 4:877b4e9cad76 | 96 | if((Ancienne_moyenne_p19 - Nouvelle_moyenne_p19) > 40960 || (Nouvelle_moyenne_p19 - Ancienne_moyenne_p19) > 40960 || (Ancienne_moyenne_p20 - Nouvelle_moyenne_p20) > 40960 || (Nouvelle_moyenne_p20 - Ancienne_moyenne_p20) > 40960) |
kkalsi | 3:637374dbfc6d | 97 | { |
kkalsi | 4:877b4e9cad76 | 98 | // associte data structure to memory pool |
kkalsi | 4:877b4e9cad76 | 99 | analogData = mpool.alloc(); |
kkalsi | 4:877b4e9cad76 | 100 | |
kkalsi | 5:85cbea9f3eb7 | 101 | if((Ancienne_moyenne_p19 - Nouvelle_moyenne_p19) > 40960 || (Nouvelle_moyenne_p19 - Ancienne_moyenne_p19) > 40960) |
kkalsi | 5:85cbea9f3eb7 | 102 | { |
kkalsi | 5:85cbea9f3eb7 | 103 | analogData->pinNumero = 19; |
kkalsi | 5:85cbea9f3eb7 | 104 | analogData->info = (Nouvelle_moyenne_p19/5); |
kkalsi | 5:85cbea9f3eb7 | 105 | } |
kkalsi | 4:877b4e9cad76 | 106 | if((Ancienne_moyenne_p20 - Nouvelle_moyenne_p20) > 40960 || (Nouvelle_moyenne_p20 - Ancienne_moyenne_p20) > 40960) |
kkalsi | 4:877b4e9cad76 | 107 | { |
kkalsi | 5:85cbea9f3eb7 | 108 | analogData->info = (Nouvelle_moyenne_p20/5); |
kkalsi | 5:85cbea9f3eb7 | 109 | analogData->pinNumero = 20; |
kkalsi | 4:877b4e9cad76 | 110 | } |
kkalsi | 5:85cbea9f3eb7 | 111 | |
kkalsi | 5:85cbea9f3eb7 | 112 | analogData->type = POTENTIOMETRE; |
kkalsi | 4:877b4e9cad76 | 113 | analogData->seconds = time(NULL); |
kkalsi | 4:877b4e9cad76 | 114 | queue.put(analogData); |
kkalsi | 3:637374dbfc6d | 115 | } |
kkalsi | 5:85cbea9f3eb7 | 116 | |
kkalsi | 3:637374dbfc6d | 117 | // mise a jour de l'ancienne moyenne pour les 2 potentiometres |
kkalsi | 3:637374dbfc6d | 118 | if(tab_counter % 5 == 0) |
kkalsi | 4:877b4e9cad76 | 119 | { |
kkalsi | 4:877b4e9cad76 | 120 | Ancienne_moyenne_p20 = Nouvelle_moyenne_p20; |
kkalsi | 3:637374dbfc6d | 121 | Ancienne_moyenne_p19 = Nouvelle_moyenne_p19; |
kkalsi | 3:637374dbfc6d | 122 | } |
kkalsi | 5:85cbea9f3eb7 | 123 | |
kkalsi | 5:85cbea9f3eb7 | 124 | tab_counter = tab_counter % 5 + 1; // incrémentation de i |
kkalsi | 3:637374dbfc6d | 125 | } |
kkalsi | 3:637374dbfc6d | 126 | } |
vincentlabbe | 1:a18a07e03e7d | 127 | |
kkalsi | 3:637374dbfc6d | 128 | // Thread pour lecture numérique |
kkalsi | 3:637374dbfc6d | 129 | void lecture_num(void const *args) |
kkalsi | 3:637374dbfc6d | 130 | { |
kkalsi | 5:85cbea9f3eb7 | 131 | //int counterRTC = 0; |
kkalsi | 3:637374dbfc6d | 132 | while (true) |
kkalsi | 3:637374dbfc6d | 133 | { |
kkalsi | 5:85cbea9f3eb7 | 134 | Thread::signal_wait(SIGNAL_NUM); // WAITING STATE (waiting for an event) |
kkalsi | 5:85cbea9f3eb7 | 135 | /* |
kkalsi | 5:85cbea9f3eb7 | 136 | if(counterRTC == 1000) |
kkalsi | 5:85cbea9f3eb7 | 137 | { |
kkalsi | 5:85cbea9f3eb7 | 138 | time_t seconds = time(NULL); |
kkalsi | 5:85cbea9f3eb7 | 139 | printf("\n\r"); |
kkalsi | 5:85cbea9f3eb7 | 140 | printf("valider les frequences dechantillonnage pour numerique\n\r"); |
kkalsi | 5:85cbea9f3eb7 | 141 | printf("Nombre de secondes passer pour 1000 iterations = %d\n\r", seconds); |
kkalsi | 5:85cbea9f3eb7 | 142 | printf("Secondes/iterations = %f\n\r", ((float)seconds/1000)); |
kkalsi | 5:85cbea9f3eb7 | 143 | } |
kkalsi | 5:85cbea9f3eb7 | 144 | counterRTC++; |
kkalsi | 5:85cbea9f3eb7 | 145 | */ |
kkalsi | 4:877b4e9cad76 | 146 | // create data structure |
kkalsi | 4:877b4e9cad76 | 147 | data *numData; |
kkalsi | 4:877b4e9cad76 | 148 | |
kkalsi | 3:637374dbfc6d | 149 | currentStateButton1 = en_1.read(); // lecture courante numérique button 1 |
kkalsi | 3:637374dbfc6d | 150 | currentStateButton2 = en_2.read(); // lecture courante numerique button 2 |
vincentlabbe | 2:1303607f8777 | 151 | |
kkalsi | 3:637374dbfc6d | 152 | if(previousStateButton1 != currentStateButton1 || previousStateButton2 != currentStateButton2) // détection de changement d'état pour les 2 buttons |
kkalsi | 3:637374dbfc6d | 153 | { |
kkalsi | 3:637374dbfc6d | 154 | Thread::wait(50); // période de stabilisation de 50ms |
kkalsi | 3:637374dbfc6d | 155 | |
kkalsi | 3:637374dbfc6d | 156 | validationStateButton1 = en_1.read(); // nouvelle lecture apres stabilisation button 1 |
kkalsi | 3:637374dbfc6d | 157 | validationStateButton2 = en_2.read(); // nouvelle lecture apres stabilisation button 2 |
kkalsi | 3:637374dbfc6d | 158 | |
kkalsi | 4:877b4e9cad76 | 159 | if(currentStateButton1 == validationStateButton1 || currentStateButton2 == validationStateButton2) |
kkalsi | 4:877b4e9cad76 | 160 | { |
kkalsi | 4:877b4e9cad76 | 161 | // associte data structure to memory pool |
kkalsi | 4:877b4e9cad76 | 162 | numData = mpool.alloc(); |
kkalsi | 4:877b4e9cad76 | 163 | |
kkalsi | 4:877b4e9cad76 | 164 | if(previousStateButton1 != currentStateButton1) |
kkalsi | 4:877b4e9cad76 | 165 | { |
kkalsi | 4:877b4e9cad76 | 166 | numData->pinNumero = 15; |
kkalsi | 5:85cbea9f3eb7 | 167 | numData->info = currentStateButton1; |
kkalsi | 4:877b4e9cad76 | 168 | } |
kkalsi | 4:877b4e9cad76 | 169 | |
kkalsi | 4:877b4e9cad76 | 170 | if(previousStateButton2 != currentStateButton2) |
kkalsi | 4:877b4e9cad76 | 171 | { |
kkalsi | 4:877b4e9cad76 | 172 | numData->pinNumero = 16; |
kkalsi | 5:85cbea9f3eb7 | 173 | numData->info = currentStateButton2; |
kkalsi | 4:877b4e9cad76 | 174 | } |
kkalsi | 4:877b4e9cad76 | 175 | |
kkalsi | 5:85cbea9f3eb7 | 176 | numData->type = BOUTON; |
kkalsi | 4:877b4e9cad76 | 177 | numData->seconds = time(NULL); |
kkalsi | 4:877b4e9cad76 | 178 | queue.put(numData); |
kkalsi | 4:877b4e9cad76 | 179 | } |
kkalsi | 4:877b4e9cad76 | 180 | |
vincentlabbe | 2:1303607f8777 | 181 | } |
kkalsi | 3:637374dbfc6d | 182 | previousStateButton1 = validationStateButton1; // mise a jour de l'état précédente button 1 |
kkalsi | 3:637374dbfc6d | 183 | previousStateButton2 = validationStateButton2; // mise a jour de l'etat precedente button 2 |
kkalsi | 3:637374dbfc6d | 184 | } |
kkalsi | 3:637374dbfc6d | 185 | } |
kkalsi | 3:637374dbfc6d | 186 | |
kkalsi | 4:877b4e9cad76 | 187 | // Thread pour afficher les evenements |
kkalsi | 4:877b4e9cad76 | 188 | void collection(void const *args) { |
kkalsi | 4:877b4e9cad76 | 189 | while (true) { |
kkalsi | 4:877b4e9cad76 | 190 | |
kkalsi | 4:877b4e9cad76 | 191 | // get data from queue and store in evt |
kkalsi | 4:877b4e9cad76 | 192 | evt = queue.get(); |
kkalsi | 4:877b4e9cad76 | 193 | // error check |
kkalsi | 4:877b4e9cad76 | 194 | if (evt.status == osEventMessage) { |
kkalsi | 4:877b4e9cad76 | 195 | // retrive information from queue to data structure |
kkalsi | 4:877b4e9cad76 | 196 | data *dataDisplay = (data*)evt.value.p; |
kkalsi | 4:877b4e9cad76 | 197 | |
kkalsi | 6:a16c0a024fd5 | 198 | printf("Pin numero = %d \t", dataDisplay->pinNumero); |
kkalsi | 4:877b4e9cad76 | 199 | // conversion des secondes en format AA:MM:JJ:HH:MM:SS |
kkalsi | 6:a16c0a024fd5 | 200 | timeinfo = localtime(&dataDisplay->seconds); |
kkalsi | 6:a16c0a024fd5 | 201 | |
kkalsi | 6:a16c0a024fd5 | 202 | //strftime(buffer, 32, "%y:%m:%d:%H:%M:%S \n\r", localtime(&dataDisplay->seconds)); |
kkalsi | 6:a16c0a024fd5 | 203 | //printf("Time as a custom formatted string = %s\n\r", buffer); |
kkalsi | 6:a16c0a024fd5 | 204 | |
kkalsi | 6:a16c0a024fd5 | 205 | printf ("Current local time and date: %d:%.2d:%.2d:%.2d:%.2d:%.2d \t", (1900 + timeinfo->tm_year),(timeinfo->tm_mon + 1), (timeinfo->tm_mday), timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec); |
kkalsi | 5:85cbea9f3eb7 | 206 | |
kkalsi | 5:85cbea9f3eb7 | 207 | if(dataDisplay->type == POTENTIOMETRE) |
kkalsi | 5:85cbea9f3eb7 | 208 | { |
kkalsi | 6:a16c0a024fd5 | 209 | printf("Moyenne courante = %d \t\n\r", dataDisplay->info); |
kkalsi | 5:85cbea9f3eb7 | 210 | } |
kkalsi | 5:85cbea9f3eb7 | 211 | |
kkalsi | 5:85cbea9f3eb7 | 212 | if(dataDisplay->type == BOUTON) |
kkalsi | 5:85cbea9f3eb7 | 213 | { |
kkalsi | 6:a16c0a024fd5 | 214 | printf("etat = %d \t\n\r", dataDisplay->info); |
kkalsi | 5:85cbea9f3eb7 | 215 | } |
kkalsi | 4:877b4e9cad76 | 216 | |
kkalsi | 4:877b4e9cad76 | 217 | mpool.free(dataDisplay); // free memory pool |
kkalsi | 4:877b4e9cad76 | 218 | } |
kkalsi | 4:877b4e9cad76 | 219 | } |
kkalsi | 4:877b4e9cad76 | 220 | } |
kkalsi | 4:877b4e9cad76 | 221 | |
kkalsi | 4:877b4e9cad76 | 222 | |
kkalsi | 3:637374dbfc6d | 223 | // sampling timer |
kkalsi | 3:637374dbfc6d | 224 | void interuptTimer() |
kkalsi | 3:637374dbfc6d | 225 | { |
kkalsi | 3:637374dbfc6d | 226 | if (ISRcounter % 2 == 0) //permet échantillonage chaque 100ms car detecter 1 fois sur 2 |
kkalsi | 3:637374dbfc6d | 227 | { |
kkalsi | 5:85cbea9f3eb7 | 228 | threadNumerique->signal_set(SIGNAL_NUM); //event occurs to trigger in response to signal waiting state |
vincentlabbe | 2:1303607f8777 | 229 | } |
kkalsi | 5:85cbea9f3eb7 | 230 | |
kkalsi | 3:637374dbfc6d | 231 | if (ISRcounter % 5 == 0) ////permet échantillonage chaque 250ms |
kkalsi | 3:637374dbfc6d | 232 | { |
kkalsi | 5:85cbea9f3eb7 | 233 | threadAnalogique->signal_set(SIGNAL_ANALOG); //event occurs to trigger in response to signal waiting state |
vincentlabbe | 2:1303607f8777 | 234 | } |
vincentlabbe | 2:1303607f8777 | 235 | |
kkalsi | 3:637374dbfc6d | 236 | ISRcounter++; |
vincentlabbe | 1:a18a07e03e7d | 237 | } |
vincentlabbe | 0:0fb169e1b9b4 | 238 | |
vincentlabbe | 0:0fb169e1b9b4 | 239 | int main() { |
kkalsi | 6:a16c0a024fd5 | 240 | set_time(1505829060); // Set RTC time to today |
kkalsi | 3:637374dbfc6d | 241 | |
kkalsi | 3:637374dbfc6d | 242 | Thread thread1; //Create thread 1, READY state |
kkalsi | 3:637374dbfc6d | 243 | threadNumerique = &thread1; |
kkalsi | 3:637374dbfc6d | 244 | |
kkalsi | 3:637374dbfc6d | 245 | Thread thread2; //Create thread 2, READY state |
kkalsi | 4:877b4e9cad76 | 246 | threadAnalogique = &thread2; |
kkalsi | 4:877b4e9cad76 | 247 | |
kkalsi | 4:877b4e9cad76 | 248 | Thread thread3; //Create thread 3, READY state |
kkalsi | 4:877b4e9cad76 | 249 | threadCollection = &thread3; |
kkalsi | 3:637374dbfc6d | 250 | |
kkalsi | 3:637374dbfc6d | 251 | threadNumerique->start(callback(lecture_num, (void *)NULL)); // RUNNING state |
kkalsi | 3:637374dbfc6d | 252 | |
kkalsi | 3:637374dbfc6d | 253 | threadAnalogique->start(callback(lecture_analog, (void *)NULL)); // RUNNING state |
kkalsi | 3:637374dbfc6d | 254 | |
kkalsi | 4:877b4e9cad76 | 255 | threadCollection->start(callback(collection, (void *)NULL)); // RUNNING state |
kkalsi | 4:877b4e9cad76 | 256 | |
kkalsi | 5:85cbea9f3eb7 | 257 | //set_time(0); // Set RTC time to debut de la terre |
kkalsi | 3:637374dbfc6d | 258 | sample.attach(&interuptTimer, 0.05); // période d'échantillonage chaque 50ms |
kkalsi | 3:637374dbfc6d | 259 | while(1) {} |
vincentlabbe | 0:0fb169e1b9b4 | 260 | } |
vincentlabbe | 1:a18a07e03e7d | 261 |