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
main.cpp@27:4fc46d79da87, 2020-09-08 (annotated)
- Committer:
- cr7sim
- Date:
- Tue Sep 08 14:06:19 2020 +0000
- Revision:
- 27:4fc46d79da87
- Parent:
- 26:175a716a53ee
- Child:
- 28:92e2e6708035
version 1: commande led bleue avec SW8
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dan | 0:7dec7e9ac085 | 1 | #include "mbed.h" |
dan | 0:7dec7e9ac085 | 2 | |
cr7sim | 27:4fc46d79da87 | 3 | DigitalOut Led_bleue(LED3); |
cr7sim | 27:4fc46d79da87 | 4 | DigitalIn BP2 (SW2); |
dan | 0:7dec7e9ac085 | 5 | |
cr7sim | 27:4fc46d79da87 | 6 | int main(){ |
dan | 0:7dec7e9ac085 | 7 | while(1) { |
cr7sim | 27:4fc46d79da87 | 8 | if (BP2==1) //si le BP2 est appuyé |
cr7sim | 27:4fc46d79da87 | 9 | { |
cr7sim | 27:4fc46d79da87 | 10 | Led_bleue=1; // on eteint la led bleue |
cr7sim | 27:4fc46d79da87 | 11 | } |
cr7sim | 27:4fc46d79da87 | 12 | else // sinon |
cr7sim | 27:4fc46d79da87 | 13 | { |
cr7sim | 27:4fc46d79da87 | 14 | Led_bleue=0; // on alume la led bleue |
cr7sim | 27:4fc46d79da87 | 15 | } |
cr7sim | 27:4fc46d79da87 | 16 | } // fin boucle infinie |
cr7sim | 27:4fc46d79da87 | 17 | } // fin programme |
cr7sim | 27:4fc46d79da87 | 18 | |
cr7sim | 25:24b231c2642b | 19 |