Ben Trevett
/
Button_LED_K64
Press SW2 for red LED. Press SW3 for blue LED.
main.cpp
- Committer:
- bentrevett
- Date:
- 2015-12-31
- Revision:
- 1:dfc1069a94f5
- Parent:
- 0:b9aa0612f361
- Child:
- 2:381e5197a992
File content as of revision 1:dfc1069a94f5:
#include "mbed.h" DigitalOut red(LED1); DigitalOut blue(LED3); DigitalIn sw2(PTC6); InterruptIn sw3(PTA4); int main() { while(1) { blue=1; //turns LED off red=1; if(sw2==0) { red = 0; //turns LED on } if(sw3==0) { blue = 0; } } }