Newbie here ... do not assume that I know what I am doing ...
Any guidance is appreciated.
I am trying to communicate with a Real Time Clock Module, and I do not understand what is wrong
Hardware:
RTC: DS3231
Board: Nano Every (authentic Arduino not a knock off)
For troubleshooting I am running the following sketch
#include <RTClib.h>
RTC_DS3231 rtc; // setup the Real Time Clock
// Define Variables
char DaysOfTheWeek[7][12] = {"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};
void setup() {
// Start the Serial Port
Serial.begin(9600);
}
void loop() {
DateTime now = rtc.now();
Serial.print(now.year(), DEC);
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.print(now.day(), DEC);
Serial.print(" (");
Serial.print(DaysOfTheWeek[now.dayOfTheWeek()]);
Serial.print(") ");
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println();
Serial.println();
delay(3000);
}
My RTC is running and has the current time and date. I just loaded this sketch onto an UNO and it works fine, I get the current time and date. When I download the sketch to the Nano Every, I get the following;
2165/165/165 (Saturday) 165:165:85
So, I think there must me something that I do not understand about the Nano Every SDA SCL pins, I am using A4-SDA, A5-SCL I've check these a couple of times.
For troubleshooting I have both a Nano Every and Uno here, and again this runs fine on the Uno so I'm confident that the RTC is running and has the current time. Also, this is my first experience with the Every board, so I think it highly likely that I just confused on how it handles the TWI.
Any suggestions or feedback is appreciated.
Thanks