-
1Installing Software
- Python with cv2 library for image processing.
- My img2lcdino script.
- Some editor to split video into frames (I suggest that you use ffmpeg).
- Arduino IDE.
-
2Preparing Your Video
First you should resize your video to fit a 23x17 viewport. You may do it with any video editor you like. For example, ffmpeg, which is a useful command line tool for video processing. The command would look like this:
ffmpeg -i input.mp4 -vf scale=24x18 output.mp4
Note that ffmpeg does not allow odd video dimensions like 23x17. So 24x18 would be ok.
Now you should split your video into frames. Again, you may use any video processing tool you like. With ffmpeg the command would look like this:
ffmpeg -i output.mp4 -r 10 output_%04d.png
This command will produce a lot of png images named output_0001.png, output_0002.png etc. The -r 10 flag means that you want 10 images per second. Note that LCD display update rate is not very high, so 10fps is a reasonable guess to start with.
-
3Converting Frames Into Arduino Code
I’ve made a Python script to generate an Arduino sketch from a series of frames. It is distributed under GNU General Public License v3.0, so feel free to modify it for your purpose. It needs cv2 library to work properly.
It loads each image, splits it into eight 5x8 rectangles, omitting blind zones, and generates Arduino code. You may collect further details from the attached flowchart and comments inside the code, but if you just want to get things done run the following command:
./img2lcdino.py > sketch.ino
It will produce a huge Arduino sketch.
If your sketch exceeds your microcontroller's memory, consider changing some settings in the script or generate less frames per second (see previous step).
-
4Wiring
It depends on the actual hardware you selected. The most typical layout is shown on the attached figure. Don't forget to set correct pins in the generated sketch:
LiquidCrystal lcd(/*your actual pins*/);
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.