Adventures with Arduino Part 36

 

Just looking at the tiny RTC (Real time clock module) for the Arduino.  I have soldered header pins on and am currently looking at how to wire this up and get it working so that the time can be read via the serial port. (or sent to an LCD screen)

I found some instructions + code for this,  so may start experimenting and see what happens.

Additional information regarding the I2C pins.

As I am using an Arduino Nano I am looking at the information page for this to determine which pins I need for SDA and SCL.

In this case it seems to be:

“I2C: A4 (SDA) and A5 (SCL)

Initial results not as expected

 

 

 

 

 

 

 

However it does show that something is communicating with the Arduino.  I HAVE now set the time  / date within the Arduino code.  Code as per website.

{
  Wire.begin();
  Serial.begin(9600);
  // set the initial time here:
  // DS3231 seconds, minutes, hours, day, date, month, year
  // setDS3231time(30,47,11,3,18,4,16);
}

The set line needs to be uncommented so remove the // from the start of the line and line things up nicely (keeps code neat)

{
  Wire.begin();
  Serial.begin(9600);
  // set the initial time here:
  // DS3231 seconds, minutes, hours, day, date, month, year
 setDS3231time(30,47,11,3,18,4,16);
}

It should then display the date / time to the serial port.