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:
- 30:a2e555dce5d4
- Parent:
- 29:45c879f917cf
- Child:
- 31:544222440267
--- a/main.cpp Tue Jul 21 13:22:03 2020 +0000
+++ b/main.cpp Sat Jul 25 06:15:46 2020 +0000
@@ -1,27 +1,18 @@
#include "mbed.h"
-DigitalOut Led_verte(PTE26);
-DigitalIn BP2(SW2);
+DigitalOut Led_verte(D2);
+DigitalIn BP2(D3);
DigitalOut Led_rouge(PTB22);
DigitalIn BP3(SW3);
int main() {
while(1) {
- if (BP2==1) // si le BP2 est appuyé
+ if (BP2==0) // si le BP2 est relaché
{
- Led_verte=1; // on eteint la led verte
- }
+ Led_verte=0; // on éteint la led }
else // sinon
{
- Led_verte=0; // on allume la led bleue
- }
- if (BP3==1) // si le BP2 est appuyé
- {
- Led_rouge=1; // on eteint la led verte
- }
- else // sinon
- {
- Led_rouge=0; // on allume la led bleue
- }
+ Led_verte=1; // on allume la led
+ }
} // fin boucle infinie
} // fin programme