3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Digital Window Sticker (Arduino Controlled)

Step 7Creating and Displaying Images

Creating and Displaying Images
«
  • GIMP_new.PNG
  • GIMP_create.PNG
  • GIMP_savetemplate.PNG
  • GIMP_savetemplatedlg.PNG
  • GIMP_newWithTemplate.PNG
  • GIMP_zoom.PNG
  • font.png
  • font2.png
  • saveas.png
  • saveas2.png
  • export.png
  • SaveAsXBM.PNG
  • convert.PNG
  • last photo ←
»
This circuit reads files from the SD card and displays them on the LED display.  In order to accomplish this the following must be understood:
  • 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.
The best cross-platform tool I've found for creating .xbm files in GIMP.  .xbm files are bitmap files that run from left to right.  Each byte represents eight black or white pixels.  The images below show how to create a Digital Window Sticker template in GIMP, and how to save files as .xbm files.

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 StepDownload PDFView All StepsNext Step »
2 comments
Dec 9, 2011. 6:15 PMcedric3131 says:
can i use arduino uno ?
thanks.
Oct 28, 2011. 12:09 PMefdat says:
is it possible me building my own led display? is yes please post the schematics

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
11
Followers
2
Author:als_liahona(Andrew L. Sandoval)
I've been writing software since I was in the 6th grade. In recent years I've developed for Blue Coat Systems, what I believe is the most advanced code injection and API hooking engine for Windows ev...
more »