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:
- 27:759f79bf1765
- Parent:
- 26:c75cce78a6a5
- Child:
- 28:9b76214fb392
--- a/main.cpp Tue Sep 08 12:34:50 2020 +0000 +++ b/main.cpp Tue Sep 08 14:08:21 2020 +0000 @@ -1,12 +1,17 @@ #include "mbed.h" // c'est la bibliothèque -DigitalOut myled(LED1); +DigitalOut Led_bleue(LED3); +DigitalIn BP2 (PTC6); int main() { while(1) { // c'est la boucle - myled = 1; // my led = 1 - wait(0.2); // c'est la temporisation - myled = 0; // my led= 0 - wait(1); // c'est la temporisation - } -} + if (BP2==1) // si le BP2 est appuyé + { + Led_bleue=0; // on éteint la led bleue + } + else // sinon + { + Led_bleue=1; // on allume la led bleue + } + } // fin boucle infinie +} // fin programme