Press SW2 for red LED. Press SW3 for blue LED.

Dependencies:   mbed

main.cpp

Committer:
bentrevett
Date:
2015-12-31
Revision:
2:381e5197a992
Parent:
1:dfc1069a94f5

File content as of revision 2:381e5197a992:

#include "mbed.h"
 
DigitalOut red(LED1);        
DigitalOut blue(LED3);
DigitalIn sw2(PTC6);
DigitalIn 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;    
        }
    }
}