V03 config RTC+envoie 1 donnée/seconde
Dependencies: mbed LoRaWAN-lib SX1272Lib
Diff: app/SerialDisplay.cpp
- Revision:
- 10:1a85ff06be1a
- Parent:
- 0:45496a70a8a5
--- a/app/SerialDisplay.cpp Wed Dec 12 08:41:45 2018 +0000 +++ b/app/SerialDisplay.cpp Wed Jan 23 16:28:51 2019 +0000 @@ -248,6 +248,29 @@ SerialDisplayUpdateData( 37, NULL, 0 ); } } +void SerialDisplayRTCactive( bool etat ) +{ + if (etat==0) + { + vt.SetCursorPos( 42, 17 ); + SerialPrintCheckBox( !etat, VT100::RED ); + } + else + { + vt.SetCursorPos( 42, 17 ); + SerialPrintCheckBox( etat, VT100::GREEN ); + } +} + +void SerialDisplayTIME( int tab[6] ) +{ + for(int i=0;i<6;i++) + { + vt.SetCursorPos( (44+i), 28 ); + vt.printf( "%2d", tab[i] ); + } + +} void SerialDisplayDrawFirstLine( void ) { @@ -429,6 +452,16 @@ // "¦ ¦ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ ¦" ); SerialDisplayDrawLine( " ", " __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ " ); // "+------------+----------------------------------------------------------------+" ); + SerialDisplayDrawTopSeparator( ); + SerialDisplayDrawLine( " ConfigRTC ", " [ ]Active " ); + SerialDisplayDrawLine( " ", " 0. Valider/Quitter " ); + SerialDisplayDrawLine( " ", " 1. Heure [ ] " ); + SerialDisplayDrawLine( " ", " 2. Minute [ ] " ); + SerialDisplayDrawLine( " ", " 3. Seconde [ ] " ); + SerialDisplayDrawLine( " ", " 4. Jour [ ] " ); + SerialDisplayDrawLine( " ", " 5. Mois [ ] " ); + SerialDisplayDrawLine( " ", " 6. Annee [ ] " ); + SerialDisplayDrawLine( " ", " Selection [__] Valeur [ ] " ); SerialDisplayDrawBottomLine( ); vt.printf( "To refresh screen please hit 'r' key.\r\n" ); } @@ -442,3 +475,62 @@ { return vt.GetChar( ); } + + +void saisie_serie(int tab[6]) +{ + int inter=9; + while( inter != 0) { + + scanf("%d",&inter); //lecture saisie clavier + vt.SetCursorPos( 50, 28 ); + vt.printf( "%2d", inter ); + vt.SetCursorPos( 50, 58 ); + vt.printf( " "); + SerialDisplayTIME(tab); + switch (inter) { + case 1: + vt.SetCursorPos( 50, 58 ); + scanf("%d",&tab[0]); + vt.printf( "%2d", tab[0] ); + break; + + case 2: + vt.SetCursorPos( 50, 58 ); + scanf("%d",&tab[1]); + vt.printf( "%2d", tab[1] ); + break; + + case 3: + vt.SetCursorPos( 50, 58 ); + scanf("%d",&tab[2]); + vt.printf( "%2d", tab[2] ); + break; + + case 4: + vt.SetCursorPos( 50, 58 ); + scanf("%d",&tab[3]); + vt.printf( "%2d", tab[3] ); + break; + + case 5: + vt.SetCursorPos( 50, 58 ); + scanf("%d",&tab[4]); + vt.printf( "%2d", tab[4] ); + break; + + case 6: + vt.SetCursorPos( 50, 58 ); + scanf("%d",&tab[5]); + vt.printf( "%2d", tab[5] ); + break; + + default: + vt.SetCursorPos( 50, 58 ); + vt.printf( " "); + break; + } + } + +} +