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@25:50278907c147, 2020-04-21 (annotated)
- Committer:
- fernandac
- Date:
- Tue Apr 21 01:54:15 2020 +0000
- Revision:
- 25:50278907c147
- Parent:
- 24:7f14b70fc9ef
led parpadea
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 | |
dan | 0:7dec7e9ac085 | 3 | DigitalOut myled(LED1); |
fernandac | 25:50278907c147 | 4 | DigitalIn buton(PTA4); |
fernandac | 25:50278907c147 | 5 | Serial contador(USBTX, USBRX); |
fernandac | 25:50278907c147 | 6 | int main() |
fernandac | 25:50278907c147 | 7 | { |
dan | 0:7dec7e9ac085 | 8 | while(1) { |
fernandac | 25:50278907c147 | 9 | if (buton==1) |
fernandac | 25:50278907c147 | 10 | { |
dan | 0:7dec7e9ac085 | 11 | myled = 1; |
fernandac | 25:50278907c147 | 12 | wait(5); |
fernandac | 25:50278907c147 | 13 | myled = 0; |
fernandac | 25:50278907c147 | 14 | wait(5); |
fernandac | 25:50278907c147 | 15 | } |
fernandac | 25:50278907c147 | 16 | else if(buton==0) |
fernandac | 25:50278907c147 | 17 | { |
fernandac | 25:50278907c147 | 18 | myled = 1; |
fernandac | 25:50278907c147 | 19 | wait(5); |
fernandac | 25:50278907c147 | 20 | myled = 0; |
fernandac | 25:50278907c147 | 21 | wait(5); |
fernandac | 25:50278907c147 | 22 | } |
stevep | 4:81cea7a352b0 | 23 | } |
fernandac | 25:50278907c147 | 24 | } |