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.
Diff: Partie_4/Exercice_1.cpp
- Revision:
- 0:4651c5d6ca1e
diff -r 000000000000 -r 4651c5d6ca1e Partie_4/Exercice_1.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Partie_4/Exercice_1.cpp Thu Jun 25 16:30:18 2020 +0000 @@ -0,0 +1,31 @@ +/* +#include "mbed.h" +BusOut myleds(LED4, LED3, LED2, LED1); +Timer timer1; // définition du timer +DigitalOut sortie1(p5); +//void tache1(void); // prototype de tache1 +int main() { + char x=0; + timer1.start(); // déclenchement du timer + while(1) { + myleds.write(x); + if(timer1.read_ms()>=1000){ + if(x==15){ + x=0; + } + else{ + x++; + } + timer1.reset(); + } + if(timer1.read_ms()>=200)// + { + tache1(); // appel de la fonction tache1 + timer1.reset(); // remise à zéro du timer + } + } +} +void tache1(void){ // fonction +sortie1.write(!(sortie1.read()); // inversion +} +*/ \ No newline at end of file