in my project I connected both DS3231 and SSD1306 to I2C bus vie A4 andA5 on Arduino nano. I am able to initialize both in the code. I can display stuff on the display and I canread time into e.g. serial monitor.
This library has a cool funcion clock.dateFormat that make formiating time and date really easy.
But here is the problem.
When I try to call this function OLED display does not initialise with the message
SSD1306 allocation failed
Any idea what may be a problem here. The library I am using is
There was some issues reported in forum
There was a fix there to install which fixed reported issue but still my issue is not resolved
I can always do that . But I was hoping that maybe somehow I can fix it. I really like the way this particular library handels date and time formatting
Dziubym:
I can always do that . But I was hoping that maybe somehow I can fix it. I really like the way this particular library handels date and time formatting
If you are more specific about that, perhaps we could lend some advice. How does it handle date and time formatting, that is of special value to you?
I like the way function RTCDateTime handles all possible formats of date and time components.
I can output short, full names, numeric representations, i sorts out leading zeros etc.
I can still use this library to do this
dt = clock.getDateTime();
// For leading zero look to DS3231_dateformat example
Serial.print("Raw data: ");
Serial.print(dt.year); Serial.print("-");
Serial.print(dt.month); Serial.print("-");
Serial.print(dt.day); Serial.print(" ");
Serial.print(dt.hour); Serial.print(":");
Serial.print(dt.minute); Serial.print(":");
Serial.print(dt.second); Serial.println("");
And If I want to output "FRI" instead of 7 I need to write appropriate function.
This function would save me the hustle.
It is not that I am stuck. I can finish my project.
But I am just curious what is the reason for this error