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:c7875faa8ddf
- Parent:
- 27:53f556d60967
- Child:
- 29:45c879f917cf
--- a/main.cpp Wed Jul 15 13:52:55 2020 +0000
+++ b/main.cpp Tue Jul 21 13:12:05 2020 +0000
@@ -1,12 +1,17 @@
#include "mbed.h"
-DigitalOut myled(PTA1);
+DigitalOut Led_bleue(PTB21);
+DigitalIn BP2(SW2);
int main() {
while(1) {
- myled = 1; // led D3 allumée
- wait(1.5);
- myled = 0; // led D3 éteinte
- wait(3.5);
- }
-}
+ if (BP2==1) // si le BP2 est appuyé
+ {
+ Led_bleue=1; // on eteint la led bleue
+ }
+ else // sinon
+ {
+ Led_bleue=0; // on allume la led bleue
+ }
+ } // fin boucle infinie
+} // fin programme