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
Revision 30:643834f77e0d, committed 2020-09-09
- Comitter:
- cr7sim
- Date:
- Wed Sep 09 13:09:02 2020 +0000
- Parent:
- 29:c7336563fcd7
- Commit message:
- version 3 - GPIO avec grove
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Sep 09 12:27:15 2020 +0000
+++ b/main.cpp Wed Sep 09 13:09:02 2020 +0000
@@ -1,36 +1,26 @@
#include "mbed.h"
+ // DigitalOut Led_rouge (D2);
+ DigitalOut Led(D2);
+ // DigitalOut Led_rouge (D2);
+ DigitalIn BP2 (D3);
- 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
+ int main()
+ {
+ Led=0; // eteint a led
+
- while(1)
- {
- if (BP2==0) // si le BP2 est appuyé
- {
- Led_verte=1; // on eteint la led rouge
- }
+ while(1) {
+ if (BP2==1) // si le BP2 est appuyé
+ {
+ Led=1; // on allume la led
+ }
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
+ Led=0; //on eteint la led
}
- else // sinon
- {
- Led_rouge=0; // on allume la led rouge
- } // fin boucle infinie
- } // fin programme
+ } // fin boucle infinie
+} // fin programme
-
-}
\ No newline at end of file
+
\ No newline at end of file