I am almost there creating a datalogger with 32u4 and a Nextion 4832T035_11.
I am having real trouble reading unixtime from eeprom, following a power cycle and variables are cleared.
Saving unixtime to eeprom, address 30 (caldateadd).
void caldatestring() {//-----------------------Compile date and time "now" into a single string
caldate = "";
DateTime now = rtc.now(); //grab date & time from the RTC
long caldatetime1 = (now.unixtime());
String caldatetimehex = String(caldatetime1);
caldate += (caldatetimehex);
EEPROM.put(caldateadd, caldate); //write calibration date to eeprom
}
Retrieve caldate from eeprom, caldatesize set to 10.
void read_caldate_from_eeprom(char *bufferIn) {
for (int i = 30; i < caldate_size; i++) {
bufferIn[i] = EEPROM.read(i);
caldate = bufferIn;
}
}
If you can offer any assistance, it would be appreciated.
Thank you.
Hi,
I have that working with two other saved numbers, namely zero and gain readings of a sensor (adc), but when it comes to the 10-digit unixtime, eeprom.get just doesn't return a logical number after a power cycle.
My overly large and bloated code could use some optimization and while I usually relish a challenge, time is against me.
Does anyone know of any decent paid resources (sites) for experienced coders to trim fat using their boxes of tricks? I'm at 97% of prog space with a few more calculations and Nextion communications to do. Pretty sure a lot of it will be ditching strings in favor of chars.