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.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 32:4d02d78d0c44
- Parent:
- 31:f4772bdf91c1
- Child:
- 33:710cfcf55052
--- a/main.cpp Tue Sep 08 15:06:24 2020 +0000 +++ b/main.cpp Wed Sep 09 12:02:28 2020 +0000 @@ -1,16 +1,27 @@ #include "mbed.h" -DigitalOut Led_bleue(PTB21); +DigitalOut Led_verte(PTE26); +DigitalOut Led_rouge(PTB22); DigitalIn BP2(PTC6); +DigitalIn BP1(PTA4); int main() { while(1) { if (BP2==1) //si le BP2 est appuyé; { - Led_bleue=1; // on éteint la led bleue + Led_verte=1; // on éteint la led verte } else // sinon { - Led_bleue=0; // on allume la led bleue + Led_verte=0; // on allume la led verte + } + if (BP1==1) //si le BP1 est appuyé; + { + Led_rouge=1; // on éteint la led rouge } + else // sinon + { + Led_rouge=0; // on allume la led rouge + } + } // fin de boucle infinie } // fin programme