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:4fc46d79da87
- Parent:
- 26:175a716a53ee
- Child:
- 28:92e2e6708035
--- a/main.cpp Wed Sep 02 14:56:45 2020 +0000 +++ b/main.cpp Tue Sep 08 14:06:19 2020 +0000 @@ -1,13 +1,19 @@ #include "mbed.h" -DigitalOut myled(D3); +DigitalOut Led_bleue(LED3); +DigitalIn BP2 (SW2); -int main() { +int main(){ while(1) { - myled = 1; //eteint la led - wait(1.5); - myled = 0; // allume la led - wait(0.5); - } -} + if (BP2==1) //si le BP2 est appuyé + { + Led_bleue=1; // on eteint la led bleue + } + else // sinon + { + Led_bleue=0; // on alume la led bleue + } + } // fin boucle infinie + } // fin programme +