Creating images
Creating images
The python script works with gif files and png files. It does not support JPG or BMP images. The pics work the best if you use a black background, not a white background!!! Also, your pics need to be only 15 pixels tall. Use the python script.
- Install Python version 2.7 for Windows because Python Imaging Library isn't available for Python 3.x yet. Download from here: https://www.python.org/downloads/release/python-2714/ -- I used the "windows x86 msi installer" and installed it in the default location, c:\python27 and I checked the box to add python to the environment variables. Python installation requires a reboot.
- Install Python Imaging Library 1.1.7 for Windows. Download from here: http://www.pythonware.com/products/pil/ -- download PIL 1.1.7 for Python 2.7
- The python script is in the "convert" folder that you grabbed. Here's the easiest way to use it:
- Exit the Arduino IDE.
- Navigate to the "convert" folder.
- Put your images in the same folder as the convert.py script file. Make sure there's no spaces in the file names of the pictures.
- Open a command prompt and navigate to the folder with your convert.py script and your images.
- If you have a picture called fire.gif then type the command "python convert.py fire.gif > graphics.h" without the quotes.
- If you want to have multiple pictures, list them all in that command separated by a space. Like this, "python convert.py fire.gif fire2.gif fire3.gif > graphics.h" without the quotes.
- The command should finish quickly and with no messages. It will generate that graphics.h file in the same folder.
- Put the graphics.h file in the same folder as your poi.ino file. Pro tip -- come up with different names for the graphics.h files so that you can keep a whole bunch of versions.
- Reopen the poi.ino file in the Arduino IDE and make sure the "graphics.h" name in the sketch matches the graphics file you want to use.
- Pro-tip -- make a batch file!
- Navigate a command prompt to the folder with your pictures.
- Do this: "dir /b > pics.doc" (you'll thank me)
- Open that pics.doc and do a find/replace, replacing ^p with a space.
- Now you have a list of your pictures separated by spaces! Delete any file names, like the convert.py and any graphics.h file that you want to remove from that set. You'll get an error message for any files that aren't gif or png.