After testing the default program supplied with the display (attached to this project), I worked to modify the program to suit my needs. The first challenge that came up was that the software was intended to be used with the Arduino Uno, but for this project I needed to use something with more pins as there were none extra available for use with the Uno. The SPI pins of the shield lined up with the SPI headers of the Uno, which are different for the Arduino Mega. The fix for this was to bend out the display pins and reroute them to the appropriate headers on the Mega.
The only other pins I needed to use were the I2C communication pins for the RTC.
In order to best observe the real time and ensure leap years are accounted for, the RTC was needed. Using the library RTClib, I found a function that allowed for me to find out what the time and date would be at a certain point in the future.
The method used to find out the days to Christmas was a very brute force method, but effective. I would continually add 60 seconds to the current time, and keep track of how many times I had to add 60 seconds to the time until the month and date equaled 12/25. Once that date was reached it would take the tallied number of minutes and translate that into days. The resulting day would be matched with the appropriate image file and displayed on the screen.
The software is linked to this project, as well as the images meant for the micro SD card. The only thing needed to get this working is to load up the micro SD card with the images, and use an RTC example sketch to set the current date and time.
I wanted to use a nice Christmas-y font for the numbers and did some research. Many of the free Christmas fonts available to use aren't terribly exciting, but I managed to find a great tutorial on making your own candy cane text.
I needed to overlay this number over a nice background, so I found a nice free-use Christmas-themed backdrop to put the custom numbers on to.
Then began the tedious task of putting together images for each day of the year, between 0 and 365. The display is able to display images of 320x480, so that was used as the basis for this. The files had to be converted to BMP in order to be used by the display. Once this was done it was loaded onto the micro SD. These images take up about 160MB, so a large micro SD card is not needed.
I enjoy making barely useful things, like my WiFi Information Station, and I love Christmas. So a permanent decoration showing the number of days until Christmas is right up my alley. I will detail the design process for anyone wanting to build this themselves.
The intention of the project is to have a real time clock will keep track of how many days there are until Christmas. A small screen will be the focal point and will load an image showing the current number of days until Christmas.
To make this easy to recreate, the design will include an Arduino Mega with a plug-in 3.5" TFT display. The display includes an SD card port where each individual number will be stored to be pulled up as needed. The microcontroller will use the RTC to determine how many days there are until Christmas, and based on that will display the correct number on the screen. It will all be enclosed in a 3D printed enclosure and decorated.