#include <Wire.h>
boolean activeSerialPrint = true;
long FechaProgramacion = 20230421;
unsigned long timeMillis = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
//-- Guardar encendidos
// eeEncendidos = EEPROM.get(eeEncendidosAddr, eeEncendidos);
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
Serial.println("Bienvenido a la Eeprom");
// activeSerialPrint = true;
printSerial("** ************************************************** **\n");
printSerial("** TEMPORIZADOR PARA KENWORTH DE AIRES ACONDICIONADOS **\n");
printSerial("** Codigo Versión 1.1 **\n");
printSerial("** Fecha de Pramacion: "+String(FechaProgramacion)+" **\n");
printSerial("** ************************************************** **\n");
printSerial("** Encendidos: ........... "+String(eeEncendidos)+"\n");
// printSerial("** Encendido Horas: ...... "+String(getAddressTimeSeconds)+"\n");
// printSerial("** Encendido Segundos: ... "+String(000)+"\n");
// activeSerialPrint = false;
printSerial("** **\n");
printSerial("** ************************************************** **\n");
printSerial("** Starting... in 2 Segundos **\n");
printSerial("** ************************************************** **\n");
// activeSerialPrint = false;
delay(2*1000);
}
void loop() {
//eeEncendidos +=1;
Serial.print("Encendidos: ");
Serial.print(eeEncendidos);
Serial.print(" ");
Serial.println(String(eeEncendidos, HEX));
//EEPROM.put(eeEncendidosAddr, eeEncendidos);
timeMillis = millis();
// printSerial("\n/*********************** START ***********************/\n");
// put your main code here, to run repeatedly:
led13();
// Atrazo considerable
delay(1000);
}
void getDataEeprom(){}
void setDataEeprom(){}
void orderDataEeprom(int address){
return 0;
}
/* =================================================== */
/* =================== printSerial =================== */
unsigned long lastDelay = 0;
unsigned long deley = 50;
void printSerial(String text) {
unsigned long tiempoMillis = timeMillis;
// Validamos que este activo
if (!activeSerialPrint){
// return;
}
// if(tiempoMillis - lastDelay >= deley){
// lastDelay = tiempoMillis;
Serial.print(text);
// }
}
int delay1 = 50;
int delay2 = 500;
void led13(){
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(delay1); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(delay1);
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(delay1); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(delay1);
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(delay1); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(delay2);
}