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
Fork of DHT11_with_Nucleo by
main.cpp@1:c0c5b5860aa8, 2015-01-05 (annotated)
- Committer:
- kaliczp
- Date:
- Mon Jan 05 22:48:28 2015 +0000
- Revision:
- 1:c0c5b5860aa8
- Parent:
- 0:e8a1a503d390
- Child:
- 2:4469aa7f4995
LED on when button pressed.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| kaliczp | 0:e8a1a503d390 | 1 | #include "mbed.h" |
| kaliczp | 0:e8a1a503d390 | 2 | |
| kaliczp | 0:e8a1a503d390 | 3 | DigitalOut myled(LED1); |
| kaliczp | 1:c0c5b5860aa8 | 4 | DigitalIn mybutton(USER_BUTTON); |
| kaliczp | 0:e8a1a503d390 | 5 | |
| kaliczp | 0:e8a1a503d390 | 6 | int main() { |
| kaliczp | 0:e8a1a503d390 | 7 | while(1) { |
| kaliczp | 1:c0c5b5860aa8 | 8 | if (mybutton == 0) { // Button is pressed |
| kaliczp | 1:c0c5b5860aa8 | 9 | myled = 1; // LED is ON |
| kaliczp | 1:c0c5b5860aa8 | 10 | } else { |
| kaliczp | 1:c0c5b5860aa8 | 11 | myled = 0; // LED is OFF |
| kaliczp | 1:c0c5b5860aa8 | 12 | } |
| kaliczp | 0:e8a1a503d390 | 13 | } |
| kaliczp | 0:e8a1a503d390 | 14 | } |
