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.
Revision 25:50278907c147, committed 2020-04-21
- Comitter:
- fernandac
- Date:
- Tue Apr 21 01:54:15 2020 +0000
- Parent:
- 24:7f14b70fc9ef
- Commit message:
- led parpadea
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 7f14b70fc9ef -r 50278907c147 main.cpp --- a/main.cpp Mon Apr 08 11:03:25 2019 +0100 +++ b/main.cpp Tue Apr 21 01:54:15 2020 +0000 @@ -1,12 +1,24 @@ #include "mbed.h" DigitalOut myled(LED1); - -int main() { +DigitalIn buton(PTA4); +Serial contador(USBTX, USBRX); +int main() +{ while(1) { + if (buton==1) + { myled = 1; - wait(0.2); - myled = 0; - wait(0.2); + wait(5); + myled = 0; + wait(5); + } + else if(buton==0) + { + myled = 1; + wait(5); + myled = 0; + wait(5); + } } -} + }