![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
logic__and
main.cpp@0:237776508c2f, 2015-06-11 (annotated)
- Committer:
- harseed951
- Date:
- Thu Jun 11 10:30:08 2015 +0000
- Revision:
- 0:237776508c2f
dsf
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
harseed951 | 0:237776508c2f | 1 | #include "mbed.h" |
harseed951 | 0:237776508c2f | 2 | |
harseed951 | 0:237776508c2f | 3 | DigitalOut a(LED1); |
harseed951 | 0:237776508c2f | 4 | DigitalOut b(LED2); |
harseed951 | 0:237776508c2f | 5 | DigitalOut c(LED3); |
harseed951 | 0:237776508c2f | 6 | DigitalOut d(LED4); |
harseed951 | 0:237776508c2f | 7 | int main() { |
harseed951 | 0:237776508c2f | 8 | while(1) { |
harseed951 | 0:237776508c2f | 9 | int i=1,j=1,q; |
harseed951 | 0:237776508c2f | 10 | q=i*j; |
harseed951 | 0:237776508c2f | 11 | switch(q) |
harseed951 | 0:237776508c2f | 12 | { |
harseed951 | 0:237776508c2f | 13 | case 1: |
harseed951 | 0:237776508c2f | 14 | a=i;b=j;c=1; |
harseed951 | 0:237776508c2f | 15 | break; |
harseed951 | 0:237776508c2f | 16 | case 0: |
harseed951 | 0:237776508c2f | 17 | a=i;b=j;c=0; |
harseed951 | 0:237776508c2f | 18 | break; |
harseed951 | 0:237776508c2f | 19 | } |
harseed951 | 0:237776508c2f | 20 | } |
harseed951 | 0:237776508c2f | 21 | } |
harseed951 | 0:237776508c2f | 22 | |
harseed951 | 0:237776508c2f | 23 |