pp
Dependencies: mbed
Diff: main.cpp
- Revision:
- 2:6b4dda997dc0
- Parent:
- 1:ba7154d2d7ca
- Child:
- 3:dc88b52d526c
--- a/main.cpp Sat Dec 05 14:01:16 2015 +0000 +++ b/main.cpp Sat Dec 05 14:32:27 2015 +0000 @@ -11,19 +11,25 @@ int main() { b.mode(PullUp); + int n=0; // DisplayTime(); display.Displayset(0x77,5,5,5); while(1) { - display.getButtonState(); - if(b==0b011){led=0b100;mode=1;} - else if(b==0b101){led=0b010;mode=2;} - else if(b==0b110){led=0b001;mode=3;} + if(b==0b011){n=1;} + else if(b==0b101){n=2;} + else if(b==0b110){n=3;} + else n=0; + display.getButtonState(n); + if(display.checkButton1()==1){led=0b100;mode=1;} + else if(display.checkButton2()==1){led=0b010;mode=2;} + else if(display.checkButton3()==1){led=0b001;mode=3;} - printf("%d",mode); - /*if(mode==1)led=0b100; - else if(mode==2)led=0b010; - else if(mode==3)led=0b001;*/ + wait_ms(100); + + //printf("%d\n",mode); + + wait_ms(100); } }