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@2:9ab3eb98ce0d, 2021-08-25 (annotated)
- Committer:
- nicmoseli
- Date:
- Wed Aug 25 20:32:38 2021 +0000
- Revision:
- 2:9ab3eb98ce0d
- Parent:
- 1:b903d66801e3
bugs fix, button added
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| nicmoseli | 1:b903d66801e3 | 1 | #include <mbed.h> |
| nicmoseli | 0:60143ecaf350 | 2 | |
| nicmoseli | 2:9ab3eb98ce0d | 3 | DigitalOut myled(LED1); |
| nicmoseli | 2:9ab3eb98ce0d | 4 | DigitalIn btn(BUTTON1); |
| nicmoseli | 0:60143ecaf350 | 5 | |
| nicmoseli | 0:60143ecaf350 | 6 | int main (void) |
| nicmoseli | 0:60143ecaf350 | 7 | { |
| nicmoseli | 2:9ab3eb98ce0d | 8 | while(1){ |
| nicmoseli | 2:9ab3eb98ce0d | 9 | if(btn == 0){ |
| nicmoseli | 2:9ab3eb98ce0d | 10 | myled = 1; |
| nicmoseli | 2:9ab3eb98ce0d | 11 | wait(0.1); |
| nicmoseli | 2:9ab3eb98ce0d | 12 | myled = 0; |
| nicmoseli | 2:9ab3eb98ce0d | 13 | wait(0.1); |
| nicmoseli | 2:9ab3eb98ce0d | 14 | }else{ |
| nicmoseli | 2:9ab3eb98ce0d | 15 | myled = 1; |
| nicmoseli | 2:9ab3eb98ce0d | 16 | wait(0.2); |
| nicmoseli | 2:9ab3eb98ce0d | 17 | myled = 0; |
| nicmoseli | 2:9ab3eb98ce0d | 18 | wait(0.5); |
| nicmoseli | 2:9ab3eb98ce0d | 19 | } |
| nicmoseli | 2:9ab3eb98ce0d | 20 | } |
| nicmoseli | 0:60143ecaf350 | 21 | } |