Joel Manuel Fernandez Cuyubamba
/
Partie4
TD
exercice1.cpp@0:e54fcd358582, 2016-05-02 (annotated)
- Committer:
- jomfec
- Date:
- Mon May 02 09:05:23 2016 +0000
- Revision:
- 0:e54fcd358582
INFO2
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jomfec | 0:e54fcd358582 | 1 | /* |
jomfec | 0:e54fcd358582 | 2 | #include "mbed.h" |
jomfec | 0:e54fcd358582 | 3 | Timer timer1; // définition du timer |
jomfec | 0:e54fcd358582 | 4 | DigitalOut sortie1(p5); |
jomfec | 0:e54fcd358582 | 5 | void tache1(void); // prototype de tache1 |
jomfec | 0:e54fcd358582 | 6 | |
jomfec | 0:e54fcd358582 | 7 | int main() { |
jomfec | 0:e54fcd358582 | 8 | timer1.start(); // déclenchement du timer |
jomfec | 0:e54fcd358582 | 9 | while(1) { |
jomfec | 0:e54fcd358582 | 10 | if (timer1.read_ms()>=200)// |
jomfec | 0:e54fcd358582 | 11 | { |
jomfec | 0:e54fcd358582 | 12 | tache1(); // appel de la fonction tache1 |
jomfec | 0:e54fcd358582 | 13 | timer1.reset(); // remise à zéro du timer |
jomfec | 0:e54fcd358582 | 14 | } |
jomfec | 0:e54fcd358582 | 15 | } |
jomfec | 0:e54fcd358582 | 16 | } |
jomfec | 0:e54fcd358582 | 17 | void tache1(){ // fonction |
jomfec | 0:e54fcd358582 | 18 | sortie1.write(!(sortie1.read())); // inversion |
jomfec | 0:e54fcd358582 | 19 | } |
jomfec | 0:e54fcd358582 | 20 | */ |