Augusto Panecatl
/
GPIO_RGB
GPIO + IRQ code example for FRDM-KL25Z
Diff: main.cpp
- Revision:
- 0:9bb80fc4800d
diff -r 000000000000 -r 9bb80fc4800d main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Jun 04 19:22:26 2014 +0000 @@ -0,0 +1,33 @@ +#include "mbed.h" + +//Delay declared in seconds + +DigitalOut Red(LED1); +DigitalOut Green(LED2); +DigitalOut Blue(LED3); +DigitalIn enable(PTB11, PullUp); + + +int main() +{ + while(1) + { + if(enable) + { + Red = 0; + wait(.2); + Red = 1; + wait(1); + + Green=0; + wait(.2); + Green=1; + wait(1); + + Blue=0; + wait(.2); + Blue=1; + wait(1); + } + } +}