prueba exitosa matrix
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
#include <Arduino.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
|
||||
|
||||
#include <ArduinoJson.h>
|
||||
#include <NTPClient.h>
|
||||
#include <WiFiUdp.h>
|
||||
//#include <TaskScheduler.h>
|
||||
|
||||
WiFiUDP ntpUDP;
|
||||
NTPClient timeClient(ntpUDP, "0.south-america.pool.ntp.org", -18000, 6000);
|
||||
@@ -18,16 +16,6 @@ const char *password = "un260874";
|
||||
long timeAnterior;
|
||||
long matrix_time;
|
||||
|
||||
|
||||
// void t1Callback();
|
||||
// void t2Callback();
|
||||
// void serialEvent();
|
||||
|
||||
// Task t1(120, TASK_FOREVER, &t1Callback);
|
||||
// Task t2(100, TASK_FOREVER, &t2Callback);
|
||||
|
||||
// Scheduler runner;
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
@@ -46,53 +34,16 @@ void setup()
|
||||
|
||||
timeClient.begin();
|
||||
matrix_init();
|
||||
|
||||
|
||||
// runner.init();
|
||||
// runner.addTask(t1);
|
||||
// runner.addTask(t2);
|
||||
// delay(1000);
|
||||
// t1.enable();
|
||||
// t2.enable();
|
||||
}
|
||||
// void loop()
|
||||
// {
|
||||
// runner.execute();
|
||||
// }
|
||||
|
||||
// void t1Callback()
|
||||
// {
|
||||
// ArduinoOTA.handle();
|
||||
// show_matrix();
|
||||
// }
|
||||
|
||||
// void t2Callback()
|
||||
// {
|
||||
|
||||
// if ((millis() - timeAnterior) > 1000)
|
||||
// {
|
||||
// timeAnterior = millis();
|
||||
// if (!client.connected())
|
||||
// {
|
||||
// reconnect();
|
||||
// }
|
||||
// timeClient.update(); //sincronizamos con el server NTP
|
||||
// hora = timeClient.getFormattedTime();
|
||||
// texto = mensaje + " " + hora;
|
||||
// longitud = longitud = texto.length() * 5 + 64;
|
||||
// }
|
||||
|
||||
// client.loop();
|
||||
// }
|
||||
|
||||
|
||||
void loop(){
|
||||
void loop()
|
||||
{
|
||||
ArduinoOTA.handle();
|
||||
if((millis() - matrix_time) > 100){
|
||||
if ((millis() - matrix_time) > 150)
|
||||
{
|
||||
matrix_time = millis();
|
||||
show_matrix();
|
||||
show_matrix();
|
||||
}
|
||||
|
||||
|
||||
if ((millis() - timeAnterior) > 1000)
|
||||
{
|
||||
@@ -104,8 +55,9 @@ void loop(){
|
||||
timeClient.update(); //sincronizamos con el server NTP
|
||||
hora = timeClient.getFormattedTime();
|
||||
texto = mensaje + " " + hora;
|
||||
longitud = texto.length() * 5 + 64;
|
||||
longitud = texto.length() * 5 + 64;
|
||||
}
|
||||
|
||||
client.loop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user