Alejandro M
/
TutoElectro_blinky2
Blinky tutorial using FRDM-KL25Z made by TutoElectro
Revision 0:9e88ae2a4d5f, committed 2015-01-04
- Comitter:
- Twistx77
- Date:
- Sun Jan 04 11:49:27 2015 +0000
- Commit message:
- Blinky tutorial using FRDM-KL25Z made by TutoElectro
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 9e88ae2a4d5f main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Jan 04 11:49:27 2015 +0000 @@ -0,0 +1,32 @@ +#include "mbed.h" + +DigitalOut RED(LED1,1); +PwmOut GREEN(LED2); +DigitalOut BLUE(LED3,1); + +int main() +{ + + float i; + + while(1) { + RED = 1; + BLUE = 0; + + for ( i = 0; i <= 1; i = i+0.01) { + GREEN = i; + wait_ms(10); + + } + + wait(0.2); + RED = 0; + BLUE =1; + + for ( i = 1; i>=0; i = i-0.01) { + GREEN = i; + wait_ms(10); + } + wait(0.2); + } +}
diff -r 000000000000 -r 9e88ae2a4d5f mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Jan 04 11:49:27 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5 \ No newline at end of file