OMG it works.
Thank you sooo much !
I put here some details if it can help someone else.
First, here is the result of your double I2C scan :
We can clearly see that the first bus we have 10, 68 and 75 (as we spoke before), and then on the second one we have 68 (the RTC) and 57 (his memory).
Then , I changed all the functions of my RTCLib library (Adafruit library for using RTC modules).
And now my previous code is working fine :
#include "RTClib.h"
#include <M5Stack.h>
RTC_DS3231 rtc;
char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
void setup () {
Serial.begin(9600);
M5.begin(true, false, true, true);
M5.Power.begin();
Wire1.begin(16,17);
rtc.begin();
}
void loop () {
M5.update();
M5.Lcd.fillScreen(BLACK);
//Getting the time
DateTime now = rtc.now();
M5.Lcd.setCursor(30,80);
//Printing it on M5 Lcd
M5.Lcd.print(now.year(), DEC);
M5.Lcd.print('/');
M5.Lcd.print(now.month(), DEC);
M5.Lcd.print('/');
M5.Lcd.print(now.day(), DEC);
M5.Lcd.print(" (");
M5.Lcd.print(daysOfTheWeek[now.dayOfTheWeek()]);
M5.Lcd.print(") ");
M5.Lcd.print(now.hour(), DEC);
M5.Lcd.print(':');
M5.Lcd.print(now.minute(), DEC);
M5.Lcd.print(':');
M5.Lcd.print(now.second(), DEC);
M5.Lcd.println();
delay(3000);
}
Morgan