LED_RED=SW1 LED_GREEN=SW3
Dependencies: mbed
main.cpp
- Committer:
- rcortes
- Date:
- 2014-03-13
- Revision:
- 0:d4d584f5e8fe
File content as of revision 0:d4d584f5e8fe:
//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 } }