Salve,sto avendo molti problemi con il suddetto modulo rtc,con arduino uno funziona perfettamente,ma avendo necessita di implementare un modulo wifi,sto utilizzando un weMOS D1 R2, il problema è il seguente: riesco a impostare la data , ma testandolo dal seriale ricevo alternatamente due date, quella impostata da me e quella che presumibilmente è la data preimpostata,allego uno screen del seriale e lo sketch
#include <DS1302.h>
// Init the DS1302
DS1302 rtc(D2, D3,D4);
void setup()
{
// Set the clock to run-mode, and disable the write protection
rtc.halt(false);
rtc.writeProtect(false);
// Setup Serial connection
Serial.begin(9600);
// The following lines can be commented out to use the values already stored in the DS1302
rtc.setDOW(WEDNESDAY); // Set Day-of-Week to FRIDAY
rtc.setTime(10, 39, 0); // Set the time to 12:00:00 (24hr format)
rtc.setDate(23, 5, 2018); // Set the date to August 6th, 2010
}
void loop()
{
// Send Day-of-Week
Serial.print(rtc.getDOWStr());
Serial.print(" ");
// Send date
Serial.print(rtc.getDateStr());
Serial.print(" -- ");
// Send time
Serial.println(rtc.getTimeStr());
// Wait one second before repeating :)
delay (5000);
}