![](/media/cache/profiles/38fcf18b093fdaa9016a4b84255dfcaf.jpg.50x50_q85.jpg)
LALALA
Revision 1:3a95f280192d, committed 2018-01-18
- Comitter:
- DoTTi
- Date:
- Thu Jan 18 11:05:42 2018 +0000
- Parent:
- 0:425c87a33e63
- Commit message:
- LALALALA
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Jan 15 18:05:34 2018 +0000 +++ b/main.cpp Thu Jan 18 11:05:42 2018 +0000 @@ -1,13 +1,17 @@ - #include "mbed.h" #include "BtnEventM0.h" Serial pc(USBTX, USBRX); // LSB MSB -BusOut lb(P1_13,P1_12,P1_7,P1_6,P1_4,P1_3,P1_1,P1_0,LED4,LED3,LED2,LED1); +BusOut lb(/*P1_13,P1_12,*/P1_7,P1_6,P1_4,P1_3,P1_1,P1_0,LED4,LED3,LED2,LED1); BtnEventM0 sw4(P1_16), sw3(P0_23), sw1(P0_10), sw2(P0_15); + +// Zustandsangebe +BusOut stLED(P1_13,P1_12); + + int blinkIdx = 0; int hh=0, mm=0; @@ -33,26 +37,34 @@ blinkIdx=-1; ShowMode(); } - if( t1.read_ms()>150 ) { + + + if( t1.read_ms()>50 ) { // Ausgabe (20Hz) t1.reset(); if( blinkIdx==-1 ) { mm++; - if( mm>29 ) + if( mm>59 ) { mm=0; hh++; } + if( hh>23 ) + { hh=0; } ShowTime(); } } - if( blinkIdx==0 ) { + + + if( blinkIdx==0 ) { //EditH if( sw3.CheckFlag() ) { hh++; - if( hh>20 ) hh=0; + if( hh>23 ) hh=0; ShowTime(); } } - if( blinkIdx==3 ) { + + + if( blinkIdx==3 ) { // EditM if( sw3.CheckFlag() ) { mm++; - if( mm>30 ) mm=0; + if( mm>59 ) mm=0; ShowTime(); } } @@ -61,13 +73,22 @@ void ShowMode() { - if( blinkIdx==-1 ) + if( blinkIdx==-1 ){ // 1..in die erste Zeile schreiben pc.printf("1 Clock running\n"); - if( blinkIdx==0 ) + stLED = 1; + } + + if( blinkIdx==0 ){ pc.printf("1 Edit hh\n"); - if( blinkIdx==3 ) + stLED = 2; + } + + if( blinkIdx==3 ){ pc.printf("1 Edit mm\n"); + stLED = 3; + } + // 3..BlinkIndex setzen // es blinken immer 2 Zeichen ( Spalten ) beginnend mit blinkIdx pc.printf("3 %d\n", blinkIdx); @@ -78,9 +99,3 @@ // 2..in die 2te Zeile schreiben pc.printf("2 %02d:%02d\n",hh,mm); } - - - - - -