RTC module and i2s LED


#1

i was trying to get my i2c led to have a readout of the time from RTC. wiring seems to be correct but the lcd will only say cicuito rocks but will not display the time. in monitor rtc gives correct time when tested and led says circuito rocks! when tested. how do i get the time to display on the led?


#2

HI,

In the test code provided by circuito.io, all you need to do in order to display the time on the LCD is to change the ‘Serial.print’ to ‘lcdI2C.print’, this will send the characters to the LCD rather than the serial monitor. You might need to make some adjustments to format it as you like.

Here is a code snippet for printing the time from the RTC on the LCD:
lcdI2C.clear();
DateTime now = rtc.now();
lcdI2C.print(now.month(), DEC);
lcdI2C.print(’/’);
lcdI2C.print(now.day(), DEC);
lcdI2C.print(’/’);
lcdI2C.print(now.year(), DEC);
//lcdI2C.print(" ");
lcdI2C.selectLine(2);
lcdI2C.print(now.hour(), DEC);
lcdI2C.print(’:’);
lcdI2C.print(now.minute(), DEC);
lcdI2C.print(’:’);
lcdI2C.print(now.second(), DEC);
delay(1000);

I added an ‘lcd.clear()’ at the beginning so it will print nicely.

Enjoy Making!
Ohad