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@0:c0d415da7a31, 2020-05-22 (annotated)
- Committer:
- retajima
- Date:
- Fri May 22 01:37:48 2020 +0000
- Revision:
- 0:c0d415da7a31
oi
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
retajima | 0:c0d415da7a31 | 1 | #include "mbed.h" |
retajima | 0:c0d415da7a31 | 2 | |
retajima | 0:c0d415da7a31 | 3 | DigitalOut myled(LED1); |
retajima | 0:c0d415da7a31 | 4 | DigitalIn botao(USER_BUTTON); |
retajima | 0:c0d415da7a31 | 5 | |
retajima | 0:c0d415da7a31 | 6 | int main() { |
retajima | 0:c0d415da7a31 | 7 | while(1) { |
retajima | 0:c0d415da7a31 | 8 | if (botao==0){ |
retajima | 0:c0d415da7a31 | 9 | myled = 1; // LED is ON |
retajima | 0:c0d415da7a31 | 10 | } |
retajima | 0:c0d415da7a31 | 11 | else{ |
retajima | 0:c0d415da7a31 | 12 | myled = 0; // LED is OFF |
retajima | 0:c0d415da7a31 | 13 | } |
retajima | 0:c0d415da7a31 | 14 | } |
retajima | 0:c0d415da7a31 | 15 | } |