RTC - Controllino Mini

Hello
Has anyone worked with the build in RTC on the Controllino Mini? I am having trouble setting up the RTC, the values posted in the serial monitor is just 0.

#include <SPI.h>
#include <Controllino.h> /* Usage of CONTROLLINO library allows you to use CONTROLLINO_xx aliases in your sketch. */

// The setup function runs once when you press reset (CONTROLLINO RST button) or connect power supply 
// (USB or external 12V/24V) to the CONTROLLINO.
void setup() {
 // initialize serial communication at 9600 bits per second
 Serial.begin(9600);
 Controllino_RTC_init(0);
 Controllino_SetTimeDate(3,1,10,22,14,10,10); // set initial values to the RTC chip
}

// the loop function runs over and over again forever
void loop() {
 int n; 
 Serial.print("Day: ");n = Controllino_GetDay(); Serial.println(n);
 
 Serial.print("WeekDay: ");n = Controllino_GetWeekDay(); Serial.println(n);
 
 Serial.print("Month: ");n = Controllino_GetMonth(); Serial.println(n);

 Serial.print("Year: ");n = Controllino_GetYear(); Serial.println(n);

 Serial.print("Hour: ");n = Controllino_GetHour(); Serial.println(n);

 Serial.print("Minute: "); n = Controllino_GetMinute(); Serial.println(n);

 Serial.print("Second: ");n = Controllino_GetSecond(); Serial.println(n);
 
 delay(5000); 
}

When running the code and looking in serial monitor it prints a 0 after minut, sec, day etc.
Kind regards Sigurd Havskov

You need to look at forum guides !! Post the code so it can be seen correctly and a link to the board and wiring diagram . Your post is also in the wrong section

Have you the the switch for the clock in the correct position to connect it to the bus ?

Here viewers

1 Like

Thread moved as requested.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.