
l
Dependencies: mbed
Revision 0:d3f400552657, committed 2017-11-09
- Comitter:
- jon07
- Date:
- Thu Nov 09 13:46:29 2017 +0000
- Commit message:
- oll
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r d3f400552657 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Nov 09 13:46:29 2017 +0000 @@ -0,0 +1,42 @@ +#include "mbed.h" +#include "rtos.h" + +Thread whili1; +DigitalOut Led1(PB_3); // Led1 conectado al pin D3 + +while (1) { + Led1 = !Led1; + Thread::wait(1000); //tiempo de espera para cambiar el led1 de estado + } + +Thread whili2; +DigitalOut Led2(PB_5); // Led2 conectado al pin D4 + +while (1) { + Led2 = !Led2; + Thread::wait(1200); //tiempo de espera para cambiar el led2 de estado + } + +Thread whili3; +DigitalOut Led3(PB_4); // Led3 conectado al pin D5 + +while (1) { + Led3 = !Led3; + Thread::wait(1500); //tiempo de espera para cambiar el led3 de estado + } + + +int main() +{ +whili1.start(Led1,blink); +whili2.start(Led2,blink); +whili3.start(Led3,blink); +whili1.join(); +whili2.join(); +whili3.join(); +} + +void blink(DigitalOut *led) //función que cambia el estado del led +{ + *led=!*led; + break \ No newline at end of file
diff -r 000000000000 -r d3f400552657 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Nov 09 13:46:29 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/fb8e0ae1cceb \ No newline at end of file