mhirst1960 / rubiks-clock

A clock that shows time on a Rubik's Cube
http://rubiksclock.com/
3 stars 1 forks source link

Running on arduino uno #25

Closed cozmo14047 closed 8 months ago

cozmo14047 commented 10 months ago

@mhirst1960 hi so I've got a tft touch screen connected to my arduino. Do you have any idea if it's possible and if so how to do it. I'd set the time when downloading the time and ig wouldn't be connected to the WiFi. This is a great project many thanks.

mhirst1960 commented 10 months ago

Excellent project!

So there are two parts (and I've not done either on an Arduino before but maybe I can help anyway): 1) play a gif and stop, 2) keep track of time of day even after power cycle (RTC)

Arduino/TFT/GIF

You will need to be able to show all frames in a gif in order and stop on the final frame. Based on time of day, simply pick the file based on its name. For a 12-hour clock, pick any file from here and make sure you can display it properly:

https://github.com/mhirst1960/rubiks-clock-simple/tree/main/videos/12hourclock-200x120

Adafruit has a bunch of gif examples for Arduino/TFT. But note that most of the examples play the GIF and repeat so you may need to make changes so it does not repeat. Maybe this one will help you: https://learn.adafruit.com/pyportal-animated-gif-display/overview

Real Time Clock (RTC)

Since you don't have WiFi, you will need a way to preserve the time even after unplugging power. So you probably want to add a RTC. Here is a good example that might help you:

https://www.circuitbasics.com/how-to-use-a-real-time-clock-module-with-the-arduino/

Note: things get a little more complicated if you want to support time change to/from daylight savings time in March and in November. I have a feeling that issue must have been solved on a Arduino but I haven't looked.

Questions

Which Arduino are you using and which TFT? Knowing that might help narrow down the possibilities.

cozmo14047 commented 10 months ago

Thanks for your reply I'm using arduino uno or mega and a 2.8" tft lcd shield hx834. I don't need the rtc as I will keep it always powerd on and happy to set the time when I download the code. Not sure about the gif thing. Many thanks.

cozmo14047 commented 10 months ago

@mhirst1960 ah now I get it uou mean put all gifts onto the sd card and get the code to call each one depending on the time. Thanks I'll try it tonight and let you know how it goes

mhirst1960 commented 8 months ago

@cozmo14047 I created a new repo that might be pretty close to what you are looking for. I implemented on an ESP32 based Arduino and a 128x128 pixel TFT.

https://github.com/mhirst1960/rubiks-clock-arduino

cozmo14047 commented 8 months ago

@cozmo14047 I created a new repo that might be pretty close to what you are looking for. I implemented on an ESP32 based Arduino and a 128x128 pixel TFT.

https://github.com/mhirst1960/rubiks-clock-arduino

thanks but my display is a back pack display but i do wonder if i could modify it thanks