red-blue buttons

Dependencies:   mbed

Committer:
RiP
Date:
Mon Sep 12 09:59:34 2016 +0000
Revision:
0:f0c7a0214862
Child:
1:f5e63bb24359
assignment 2a

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RiP 0:f0c7a0214862 1 #include "mbed.h"
RiP 0:f0c7a0214862 2
RiP 0:f0c7a0214862 3 DigitalIn enable(PTA4);
RiP 0:f0c7a0214862 4 DigitalIn enables(PTC6);
RiP 0:f0c7a0214862 5
RiP 0:f0c7a0214862 6 DigitalOut red(LED_RED);
RiP 0:f0c7a0214862 7 //DigitalOut green(LED_GREEN);
RiP 0:f0c7a0214862 8 DigitalOut blue(LED_BLUE);
RiP 0:f0c7a0214862 9
RiP 0:f0c7a0214862 10 int main()
RiP 0:f0c7a0214862 11 {
RiP 0:f0c7a0214862 12 while(true){
RiP 0:f0c7a0214862 13 blue=0;
RiP 0:f0c7a0214862 14 if(enable==0)
RiP 0:f0c7a0214862 15 {
RiP 0:f0c7a0214862 16 red=0;
RiP 0:f0c7a0214862 17 }
RiP 0:f0c7a0214862 18 else
RiP 0:f0c7a0214862 19 {
RiP 0:f0c7a0214862 20 red=1;
RiP 0:f0c7a0214862 21 }
RiP 0:f0c7a0214862 22 }
RiP 0:f0c7a0214862 23 }