Go Down

Topic: RTC AM PM format setting in RTC &showing ON TFT (Read 61 times) previous topic - next topic

kolhapurkar

Hello ,

I am currently working on ARDUINO uno with RTC and the RTC data display on TFT.

I have done everything  regarding to RTC using the RTClib.h and wire.h in 12 hour format but still not set the Am pm format on it.

I started the RTC in 12 hour mode like these,

    DD = now.day();
    MM = now.month();
    YY = now.year();
    H = now.hour()%12;   ///the 12 hour format
    M = now.minute();
    S = now.second();
   

It work fine but, how can i call the Am & Pm in accordance with time update?


where I will change  to get the Am PM pattern and how I call it for TFT print?





pylon

Quote
It work fine but, how can i call the Am & Pm in accordance with time update?
By changing the sketch accordingly. We cannot help because you're keeping the sketch, the wiring and all information about the hardware secret.

Quote
where I will change  to get the Am PM pattern and how I call it for TFT print?
If that snippet above is your actual code, you get the flag

Code: [Select]
bool pm = now.hour() / 12;

Go Up