@@ -388,15 +388,27 @@ void setup(void)
388
388
if (getCpuFrequencyMhz () != 160 )
389
389
setCpuFrequencyMhz (160 ); // if not 160MHz, set to 160MHz
390
390
Serial.begin (115200 );
391
+ Wire.begin ();
391
392
Serial1.begin (9600 , SERIAL_8N1, RXPin, TXPin); // for GPS running on Hardware Serial
392
393
pinMode (LCD_LIGHT, OUTPUT);
393
- analogWrite (LCD_LIGHT, 250 );
394
+ analogWrite (LCD_LIGHT, 50 );
394
395
395
396
pinMode (BUZZER_PIN, OUTPUT);
396
397
digitalWrite (BUZZER_PIN, HIGH);
397
- delay (100 );
398
+ delay (50 );
398
399
digitalWrite (BUZZER_PIN, LOW);
399
400
401
+ analogWrite (LCD_LIGHT, 250 );
402
+
403
+ u8g2.begin ();
404
+ u8g2.clearBuffer ();
405
+ u8g2.drawLine (0 , 17 , 127 , 17 );
406
+ u8g2.setFont (u8g2_font_7x14B_mr);
407
+ u8g2.setCursor (12 , 30 );
408
+ u8g2.print (" GPS Clock V2" );
409
+ u8g2.drawLine (0 , 31 , 127 , 31 );
410
+ u8g2.sendBuffer ();
411
+
400
412
if (!pref.begin (" database" , false )) // open database
401
413
errorMsgPrint (" DATABASE" , " ERROR INITIALIZE" );
402
414
@@ -449,24 +461,14 @@ void setup(void)
449
461
}
450
462
buzzVol = pref.getInt (" buzzVol" , 50 );
451
463
452
- analogWrite (LCD_LIGHT, LCD_BRIGHTNESS);
453
- Wire.begin ();
454
-
455
464
if (!lightMeter.begin (BH1750::ONE_TIME_HIGH_RES_MODE))
456
465
errorMsgPrint (" BH1750" , " CANNOT FIND" );
457
466
458
467
if (aht20.begin () != true )
459
468
{
460
469
errorMsgPrint (" AHT25" , " CANNOT FIND" );
461
470
}
462
- u8g2.begin ();
463
- u8g2.clearBuffer ();
464
- u8g2.setFont (u8g2_font_7x14B_mr);
465
- u8g2.setCursor (12 , 15 );
466
- u8g2.print (" RETRO" );
467
- u8g2.setCursor (12 , 30 );
468
- u8g2.print (" GPS CLOCK" );
469
- u8g2.sendBuffer ();
471
+
470
472
xTaskCreatePinnedToCore (
471
473
loop1, /* Task function. */
472
474
" loop1Task" , /* name of task. */
@@ -476,7 +478,7 @@ void setup(void)
476
478
&loop1Task, /* Task handle to keep track of created task */
477
479
0 ); /* pin task to core 0 */
478
480
479
- delay (2500 );
481
+ delay (1000 );
480
482
481
483
// wifi manager
482
484
if (useWifi)
@@ -615,7 +617,7 @@ void setup(void)
615
617
u8g2.setFont (u8g2_font_streamline_food_drink_t );
616
618
u8g2.drawUTF8 (80 , 54 , " U+4" ); // birthday cake icon
617
619
u8g2.sendBuffer ();
618
- delay (2500 );
620
+ delay (2000 );
619
621
620
622
pref.end ();
621
623
ahtTemp = (aht20.readTemperature () - 3 ); // NEED TO CHANGE THE SENSOR, it shows +3 degrees extra
0 commit comments