Rick Poppe
/
BLINK
red-blue buttons
main.cpp@1:f5e63bb24359, 2016-09-12 (annotated)
- Committer:
- RiP
- Date:
- Mon Sep 12 10:04:27 2016 +0000
- Revision:
- 1:f5e63bb24359
- Parent:
- 0:f0c7a0214862
red-blue
Who changed what in which revision?
User | Revision | Line number | New 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 | 1:f5e63bb24359 | 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 | 1:f5e63bb24359 | 13 | red=1;blue=1;green=1; |
RiP | 0:f0c7a0214862 | 14 | if(enable==0) |
RiP | 0:f0c7a0214862 | 15 | { |
RiP | 0:f0c7a0214862 | 16 | red=0; |
RiP | 0:f0c7a0214862 | 17 | } |
RiP | 1:f5e63bb24359 | 18 | else if(enables==0) |
RiP | 0:f0c7a0214862 | 19 | { |
RiP | 1:f5e63bb24359 | 20 | green=0; |
RiP | 0:f0c7a0214862 | 21 | } |
RiP | 1:f5e63bb24359 | 22 | |
RiP | 0:f0c7a0214862 | 23 | } |
RiP | 0:f0c7a0214862 | 24 | } |