new way init led matrix

master
JbLb 8 years ago
parent aaef5ec55a
commit b1e1db50c9

@ -88,8 +88,19 @@ void handleTelnet(void) {
void setup() {
Serial.begin(115200); // initialize serial communications
DEBUG_PRINT("\n\r");
matrix.fillScreen(LOW); //clr screen
for (int i=0; i<numberOfHorizontalDisplays; i++){
DEBUG_PRINT("Changing orientation of display #");
DEBUG_PRINTLN(i);
matrix.setRotation(i, 1);
}
display_message("Wifi");
WiFiManager wifiManager;
wifiManager.setDebugOutput(false); // no debug
wifiManager.setTimeout(180);
if(!wifiManager.autoConnect("LibreMetric")) {
DEBUG_PRINTLN(F("failed to connect and timeout occurred"));
@ -97,6 +108,7 @@ void setup() {
ESP.reset(); //reset and try again
delay(180000);
}
matrix.fillScreen(LOW);
// At this stage the WiFi manager will have successfully connected to a network, or if not will try again in 180-seconds
DEBUG_PRINTLN(F("WiFi connected..."));
DEBUG_PRINTLN(WiFi.localIP());
@ -113,15 +125,9 @@ void setup() {
DEBUG_PRINTLN(F("Webserver started..."));
matrix.setIntensity(brightness);
brightness=16;
Serial.print(numberOfHorizontalDisplays);
DEBUG_PRINT(numberOfHorizontalDisplays);
DEBUG_PRINTLN(" displays configurated...");
for (int i=0; i<numberOfHorizontalDisplays; i++){
Serial.print("Changing orientation of display #");
DEBUG_PRINTLN(i);
matrix.setRotation(i, 1);
}
server.on("/", GetMessage);
message = "Bienvenue !";

Loading…
Cancel
Save