Once I saw a beautiful box of chocolate in a store. And the thought occurred to me to make an awesome gift out of this box - an animated box with chocolate.
What we need:
- Сlear plastic chocolate box
- 9V battery
- uSD 1GB
- TFT Shield for Arduino
First, you need to open the box - gently tear off the golden adhesive tape so as not to tear it. Get the contents of the box: candy and plastic backing. In the plastic backing cut a window for TFT shield and 9V batteries.
Sketch for Arduino Uno
- Need to download the library https://github.com/YATFT/YATFT/archive/master.zip. In Arduino Uno you need to program the following sketch:
I edited a short video from a video downloaded from YouTube. To play a video in TFT shield it needs to be converted into a file with the extension *.rgb:
Download the conversion program at http://ffmpeg.org/download.html for your operating system. Install on computer. Convert the file with the following command:
ffmpeg -i video.avi -s 320x240 -pix_fmt rgb565 video.rgb
Write the resulting video.rgb file (264MB) to the microsd card (FAT32) and insert it into the TFT shield.We join together Arduino Uno and TFT shield. Now we are ready to final assembly.
At the last stage we carry out the final assembly of all components:
- We connect to the Arduino Uno cable adapter 9V.
- Carefully place the shield with Arduino Uno at the bottom of the box.
- Place the top of the plastic backing. Glue on the edges of the screen a golden adhesive tape, which at the very beginning was carefully removed from the box.
- We connect the battery 9V, we place it through a special window at the bottom of the box. Put the chocolate candies in the cells so that the candy wrappers do not close the screen.
- Close the box with a transparent lid. Enjoying the video :-)
No preview (download only).