LED_RED=SW1 LED_GREEN=SW3
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:d4d584f5e8fe
diff -r 000000000000 -r d4d584f5e8fe main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Mar 13 19:54:49 2014 +0000 @@ -0,0 +1,17 @@ +//Programa para encender los leds rojo y verde al oprimir los botones SW1 y SW2 +#include "mbed.h" +#define OFF 1 + +DigitalOut redled(LED_RED); +DigitalOut greenled(LED_GREEN); +DigitalIn sw3(PTC12); +DigitalIn sw1(PTC3); +int main() +{ + greenled = OFF; //green and red led are off + redled = OFF; + while(1) { + greenled=sw3; //green led is SW3 + redled=sw1; // red led is SW1 + } +} \ No newline at end of file