Step 7Creating and Displaying Images
- Your SD card must be formatted with a FAT16 file system. This is the default for most older cards, and cards less than 2 GB.
- FAT16 limits the number of files in the root directory to 512. The micro controller is only programmed to read files from the root directory.
- Files are read from 0.dws to 511.dws, sequentially.
- When the micro controller reaches a file it can't read (say 10.dws after reading 9.dws) it will restart at 0.dws.
- .dws files are bitmap files with the bits ordered in rows. The first eight bits fills the first row of LEDs on the left-hand side of the display. 16-bits are required for one full row, and there are 48 rows. (24-per display board.)
- To create a .dws file, start with an XBM (x-bitmap) file and use my command-line program xbmtodws to convert the file.
Conversion:
After creating the .xbm files you want to display, run them through xbmtodws. Full source code is attached for xbmtodws. It compiles on Windows with Visual Studio 2005, on Mac OS X with g++, and on Linux with g++. There is a build-linux.sh for examples of how to compile on linux, and a build-macos.sh that shows how to build on Mac.
xbmtodws requires Boost 1.40.0 header files. It uses Boost Spirit to parse the .xbm files, and Boost dynamic_bitset to simplify changing the bits from left-to-right, to top-to-bottom.
Pre-compiled versions of xbmtodws are included in the attached files (xbmtodws-1.0.zip and xbmtodws-1.0.tar.gz). The Linux version is in xbmtodws\xbmtodws\linux. The Mac version is in xbmtodws\xbmtodws\macosx. The Windows (32-bit) version is in xbmtodws\release.
xbmtodws creates a 100-byte .dws file from each 16-by-48 pixel .xbm file. 96-bytes are pixel data, and 4 bytes contain time to display the image in milliseconds.
Converting a file called fred.xbm:
Windows: xbmtodws.exe fred.xbm
Linux/Mac: xbmtodws fred.xbm
By default the image will be displayed for 1 second (1000 milliseconds) . To change the display time use the -delay nnnMilliseconds command-line argument. For example, to show the image for 10 seconds use:
xbmtodws.exe fred.xbm -delay 10000
xbmtodws will create a new file called fred.dws. To display this file, copy it to the root directory of the SD card and give it a numeric name with the .dws suffix (e.g. 0.dws). Remember that if you leave a gap in the numbers, say you have files 0.dws, 1.dws, and 3.dws, only files 0 and 1 will display. An error will be detected reading 2.dws and the microcontroller will start again at 0.dws.
Another option is to invert the image. Use the -inverse flag to invert the image when the .dws file is created.
Animations:
It is possible to create animations like those shows in the video on the Intro screen, by creating a sequence of images with small movements between frames and a short delay.
You now have complete instructions to create your own Digital Window Sticker. Please post feedback showing how you use your Digital Window Sticker!
| « Previous Step | Download PDFView All Steps | Next Step » |



























































thanks.