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.
main.cpp@0:b50423a8ab0c, 2018-09-03 (annotated)
- Committer:
- manueljml
- Date:
- Mon Sep 03 00:42:14 2018 +0000
- Revision:
- 0:b50423a8ab0c
MA?E
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| manueljml | 0:b50423a8ab0c | 1 | #include "mbed.h" |
| manueljml | 0:b50423a8ab0c | 2 | |
| manueljml | 0:b50423a8ab0c | 3 | DigitalIn mybutton(USER_BUTTON); |
| manueljml | 0:b50423a8ab0c | 4 | DigitalOut myled(LED1); |
| manueljml | 0:b50423a8ab0c | 5 | |
| manueljml | 0:b50423a8ab0c | 6 | int main() { |
| manueljml | 0:b50423a8ab0c | 7 | while(1) { |
| manueljml | 0:b50423a8ab0c | 8 | if (mybutton == 0) { // Button is pressed |
| manueljml | 0:b50423a8ab0c | 9 | myled = !myled; // Toggle the LED state |
| manueljml | 0:b50423a8ab0c | 10 | wait(0.2); // 200 ms |
| manueljml | 0:b50423a8ab0c | 11 | } |
| manueljml | 0:b50423a8ab0c | 12 | } |
| manueljml | 0:b50423a8ab0c | 13 | } |
| manueljml | 0:b50423a8ab0c | 14 |