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:a2e555dce5d4, 2020-07-25 (annotated)
- Committer:
- snec_student
- Date:
- Sat Jul 25 06:15:46 2020 +0000
- Revision:
- 30:a2e555dce5d4
- Parent:
- 29:45c879f917cf
- Child:
- 31:544222440267
version 3 - GPIO avec grove
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 | |
| snec_student | 30:a2e555dce5d4 | 3 | DigitalOut Led_verte(D2); |
| snec_student | 30:a2e555dce5d4 | 4 | DigitalIn BP2(D3); |
| snec_student | 29:45c879f917cf | 5 | DigitalOut Led_rouge(PTB22); |
| snec_student | 29:45c879f917cf | 6 | DigitalIn BP3(SW3); |
| dan | 0:7dec7e9ac085 | 7 | |
| dan | 0:7dec7e9ac085 | 8 | int main() { |
| dan | 0:7dec7e9ac085 | 9 | while(1) { |
| snec_student | 30:a2e555dce5d4 | 10 | if (BP2==0) // si le BP2 est relaché |
| snec_student | 28:c7875faa8ddf | 11 | { |
| snec_student | 30:a2e555dce5d4 | 12 | Led_verte=0; // on éteint la led } |
| snec_student | 28:c7875faa8ddf | 13 | else // sinon |
| snec_student | 28:c7875faa8ddf | 14 | { |
| snec_student | 30:a2e555dce5d4 | 15 | Led_verte=1; // on allume la led |
| snec_student | 30:a2e555dce5d4 | 16 | } |
| snec_student | 28:c7875faa8ddf | 17 | } // fin boucle infinie |
| snec_student | 28:c7875faa8ddf | 18 | } // fin programme |