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@30:643834f77e0d, 2020-09-09 (annotated)
- Committer:
- cr7sim
- Date:
- Wed Sep 09 13:09:02 2020 +0000
- Revision:
- 30:643834f77e0d
- Parent:
- 29:c7336563fcd7
version 3 - GPIO avec grove
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
cr7sim | 28:92e2e6708035 | 1 | #include "mbed.h" |
cr7sim | 30:643834f77e0d | 2 | // DigitalOut Led_rouge (D2); |
cr7sim | 30:643834f77e0d | 3 | DigitalOut Led(D2); |
cr7sim | 30:643834f77e0d | 4 | // DigitalOut Led_rouge (D2); |
cr7sim | 30:643834f77e0d | 5 | DigitalIn BP2 (D3); |
cr7sim | 28:92e2e6708035 | 6 | |
cr7sim | 28:92e2e6708035 | 7 | |
cr7sim | 28:92e2e6708035 | 8 | |
cr7sim | 30:643834f77e0d | 9 | int main() |
cr7sim | 30:643834f77e0d | 10 | { |
cr7sim | 30:643834f77e0d | 11 | Led=0; // eteint a led |
cr7sim | 30:643834f77e0d | 12 | |
cr7sim | 28:92e2e6708035 | 13 | |
cr7sim | 30:643834f77e0d | 14 | while(1) { |
cr7sim | 30:643834f77e0d | 15 | if (BP2==1) // si le BP2 est appuyé |
cr7sim | 30:643834f77e0d | 16 | { |
cr7sim | 30:643834f77e0d | 17 | Led=1; // on allume la led |
cr7sim | 30:643834f77e0d | 18 | } |
cr7sim | 28:92e2e6708035 | 19 | else // sinon |
cr7sim | 28:92e2e6708035 | 20 | { |
cr7sim | 30:643834f77e0d | 21 | Led=0; //on eteint la led |
cr7sim | 27:4fc46d79da87 | 22 | } |
cr7sim | 30:643834f77e0d | 23 | } // fin boucle infinie |
cr7sim | 30:643834f77e0d | 24 | } // fin programme |
cr7sim | 28:92e2e6708035 | 25 | |
cr7sim | 30:643834f77e0d | 26 |