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:
- 28:92e2e6708035
- Parent:
- 27:4fc46d79da87
- Child:
- 29:c7336563fcd7
--- a/main.cpp Tue Sep 08 14:06:19 2020 +0000 +++ b/main.cpp Wed Sep 09 12:24:22 2020 +0000 @@ -1,19 +1,36 @@ -#include "mbed.h" - -DigitalOut Led_bleue(LED3); -DigitalIn BP2 (SW2); - -int main(){ - while(1) { - if (BP2==1) //si le BP2 est appuyé + #include "mbed.h" + + DigitalOut Led_verte(LED2); + DigitalOut Led_rouge(LED1); + + DigitalIn BP3 (SW3); + DigitalIn BP2 (SW2); + + int main() { + Led_verte=0; // allume la led verte + Led_rouge=0; //allume la led rouge + + while(1) + { + if (BP2==0) // si le BP2 est appuyé { - Led_bleue=1; // on eteint la led bleue + Led_verte=1; // on eteint la led rouge + } + else // sinon + { + Led_verte=0; //on allume la led rouge + } + + + if (BP3==0) // si le BP2 est appuyé + { + Led_rouge=1; // on eteint la led rouge } else // sinon { - Led_bleue=0; // on alume la led bleue - } - } // fin boucle infinie - } // fin programme - - + Led_rouge=0; // on allume la led rouge + } // fin boucle infinie + } // fin programme + + +} \ No newline at end of file