Some bug fixes and enhancements

This commit is contained in:
Sébastien Vallée 2017-12-17 01:15:13 +01:00
parent 76e0e54318
commit 0e8754512a

View File

@ -43,7 +43,6 @@ void setup() {
Serial.begin(115200); // initialize serial communications Serial.begin(115200); // initialize serial communications
WiFiManager wifiManager; WiFiManager wifiManager;
wifiManager.setTimeout(180); wifiManager.setTimeout(180);
//fetches ssid and password and tries to connect, if connections succeeds it starts an access point with the name called "LibreMetric" and waits in a blocking loop for configuration
if(!wifiManager.autoConnect("LibreMetric")) { if(!wifiManager.autoConnect("LibreMetric")) {
Serial.println(F("failed to connect and timeout occurred")); Serial.println(F("failed to connect and timeout occurred"));
delay(6000); delay(6000);
@ -80,11 +79,9 @@ void loop() {
String time = String(ctime(&now)); String time = String(ctime(&now));
time.trim(); time.trim();
time.substring(11,19).toCharArray(time_value, 10); time.substring(11,19).toCharArray(time_value, 10);
matrix.drawChar(2,0, time_value[0], HIGH,LOW,1); // H for (int i = 0; i <= 4; i++) {
matrix.drawChar(8,0, time_value[1], HIGH,LOW,1); // HH matrix.drawChar(i*6+2,0, time_value[i], HIGH,LOW,1); // H
matrix.drawChar(14,0,time_value[2], HIGH,LOW,1); // HH: }
matrix.drawChar(20,0,time_value[3], HIGH,LOW,1); // HH:M
matrix.drawChar(26,0,time_value[4], HIGH,LOW,1); // HH:MM
matrix.write(); // Send bitmap to display matrix.write(); // Send bitmap to display
if (message != "") { if (message != "") {
Serial.print("On envoi \""); Serial.print("On envoi \"");