![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
dd
Fork of keerthi by
main.cpp@2:f222a223fdb3, 2015-06-25 (annotated)
- Committer:
- keerthivasan
- Date:
- Thu Jun 25 10:06:56 2015 +0000
- Revision:
- 2:f222a223fdb3
- Parent:
- 0:fb6bbc10ffa0
- Child:
- 3:449c8a9a369e
l1ds
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
simon | 0:fb6bbc10ffa0 | 1 | #include "mbed.h" |
simon | 0:fb6bbc10ffa0 | 2 | |
keerthivasan | 2:f222a223fdb3 | 3 | DigitalOut a(LED1); |
keerthivasan | 2:f222a223fdb3 | 4 | DigitalOut b(LED2); |
keerthivasan | 2:f222a223fdb3 | 5 | DigitalOut c(LED3); |
keerthivasan | 2:f222a223fdb3 | 6 | DigitalOut p(p9); |
simon | 0:fb6bbc10ffa0 | 7 | |
keerthivasan | 2:f222a223fdb3 | 8 | int main() |
keerthivasan | 2:f222a223fdb3 | 9 | { |
keerthivasan | 2:f222a223fdb3 | 10 | int i,j; |
keerthivasan | 2:f222a223fdb3 | 11 | for(i=0;i<2;i++) |
keerthivasan | 2:f222a223fdb3 | 12 | { |
keerthivasan | 2:f222a223fdb3 | 13 | for(j=0;j<2;j++) |
keerthivasan | 2:f222a223fdb3 | 14 | { |
keerthivasan | 2:f222a223fdb3 | 15 | a=i;b=j; |
keerthivasan | 2:f222a223fdb3 | 16 | c=1; |
keerthivasan | 2:f222a223fdb3 | 17 | wait(0.25); |
keerthivasan | 2:f222a223fdb3 | 18 | c=0; |
keerthivasan | 2:f222a223fdb3 | 19 | |
keerthivasan | 2:f222a223fdb3 | 20 | if(i*j==1) |
keerthivasan | 2:f222a223fdb3 | 21 | { |
keerthivasan | 2:f222a223fdb3 | 22 | p=1; |
keerthivasan | 2:f222a223fdb3 | 23 | wait(1); |
keerthivasan | 2:f222a223fdb3 | 24 | } |
keerthivasan | 2:f222a223fdb3 | 25 | else |
keerthivasan | 2:f222a223fdb3 | 26 | { |
keerthivasan | 2:f222a223fdb3 | 27 | p=0; |
keerthivasan | 2:f222a223fdb3 | 28 | wait(1); |
keerthivasan | 2:f222a223fdb3 | 29 | } |
keerthivasan | 2:f222a223fdb3 | 30 | { |
keerthivasan | 2:f222a223fdb3 | 31 | if(i*j==0) |
keerthivasan | 2:f222a223fdb3 | 32 | { |
keerthivasan | 2:f222a223fdb3 | 33 | p=1; |
keerthivasan | 2:f222a223fdb3 | 34 | wait(1); |
keerthivasan | 2:f222a223fdb3 | 35 | } |
keerthivasan | 2:f222a223fdb3 | 36 | else |
keerthivasan | 2:f222a223fdb3 | 37 | { |
keerthivasan | 2:f222a223fdb3 | 38 | p=0; |
keerthivasan | 2:f222a223fdb3 | 39 | wait(1); |
keerthivasan | 2:f222a223fdb3 | 40 | } |
keerthivasan | 2:f222a223fdb3 | 41 | if(i+j==1) |
keerthivasan | 2:f222a223fdb3 | 42 | { |
keerthivasan | 2:f222a223fdb3 | 43 | p=1; |
keerthivasan | 2:f222a223fdb3 | 44 | wait(1); |
keerthivasan | 2:f222a223fdb3 | 45 | } |
keerthivasan | 2:f222a223fdb3 | 46 | else |
keerthivasan | 2:f222a223fdb3 | 47 | { |
keerthivasan | 2:f222a223fdb3 | 48 | p=0; |
keerthivasan | 2:f222a223fdb3 | 49 | wait(1); |
keerthivasan | 2:f222a223fdb3 | 50 | } |
keerthivasan | 2:f222a223fdb3 | 51 | if(i==!j) |
keerthivasan | 2:f222a223fdb3 | 52 | { |
keerthivasan | 2:f222a223fdb3 | 53 | p=1; |
keerthivasan | 2:f222a223fdb3 | 54 | wait(1); |
keerthivasan | 2:f222a223fdb3 | 55 | } |
keerthivasan | 2:f222a223fdb3 | 56 | else |
keerthivasan | 2:f222a223fdb3 | 57 | { |
keerthivasan | 2:f222a223fdb3 | 58 | p=0; |
keerthivasan | 2:f222a223fdb3 | 59 | wait(1); |
keerthivasan | 2:f222a223fdb3 | 60 | } |
keerthivasan | 2:f222a223fdb3 | 61 | wait(2);} |
keerthivasan | 2:f222a223fdb3 | 62 | } |
keerthivasan | 2:f222a223fdb3 | 63 | } |
keerthivasan | 2:f222a223fdb3 | 64 | } |