Nokia LCD backpack utility
From DP
Contents |
Software Utility
Description/Purpose
This utility simply sends a bmp image file to the Nokia LCD Backpack using the commands described above.
Version Information
Early development stage,
BMP image sender for Nokia LCD Backpack V.0.3 Wiki Docs: http://dangerousprototypes.com/docs/Mathieu:_Another_LCD_backpack http://www.dangerousprototypes.com
Usage
Windows
Help Menu
Usage:
imageviewer -p device -f bmpfile -s speed -b bytes -V
Example Usage: imageviewer -d COM1 -s 921600 -f sample.bmp -V
imageviewer -d COM1 -s 921600 -v -a
imageviewer -d COM1 -s 921600 -i -d 20
imageviewer -d COM1 -s 921600 -i sample.bmp -B 300
Where: -p device is port e.g. COM1 (windows) or /dev/ttyS0 (*nix)
-s Speed is port Speed default is 921600
-f Filename of BMP file
-B bytes, No. Of chunks of bytes to send to the port. MAX 5460
-d percent, dim the backlight, Range (0-100)
-a LCD Backligh voltage reading
-v version information
-i Initialized and Reset LCD
-V verbose mode- show something on screen
-T Test pattern (full Screen)
-h help menu
Note that the option -p is mandatory
*NIX
Help Menu
Usage:
imageviewer -p device -f bmpfile -s speed -b bytes -V
Example Usage: imageviewer -d /dev/ttyS0 -s 921600 -f sample.bmp -v
imageviewer -d /dev/ttyS0 -s 921600 -v -a
imageviewer -d /dev/ttyS0 -s 921600 -i -d 20
Where: -p device is port e.g. COM1 (windows) or /dev/ttyS0 (*nix)
-s Speed is port Speed default is 921600
-f Filename of BMP file
-b bytes, bytes to send - must be multiple of 3's. default is 6
-d percent, dim the backlight, Range (0-100)
-a LCD Backligh voltage reading
-v version information
-i Initialized and Reset LCD
-V verbose mode- show something on screen
-T Test pattern (full Screen)
-h help menu
Screen Shots
E:\>imageviewer -p com5 -f tulips.bmp -B 600 ----------------------------------------------------------------------------- BMP image sender for Nokia LCD Backpack V.0.3 http://www.dangerousprototypes.com ----------------------------------------------------------------------------- Header size is 40 Image size is 132px x 132px Number of colour planes is 1 Bits per pixel is 24 Offset to image data is 54 bytes Setting image mode Opening Port on com5 at 921600bps, using image file tulips.bmp chunksize = 600 X 3 Ready to convert 24 bit into 12 bit image data.. Press any key when ready... sending image data.. Total Bytes Sent: 26136 Reply received: ☺ Done! :-) E:\>
Notes
This utility works on windows only and untested on other OS. This code was compiled using Code::Blocks 10.05 and used the built-in windows headers for bitmaps: BITMAPFILEHEADER and BITMAPINFO.
Program flow:
- checks for the validity of the bmp file
- display some info and get the image data offset from the header
- send 'P' to the LCD backpack, followed by the image data starting from the offset
Works on 24bit bmp only.
Download the Source
The source code compiles on both windows and debian without complain. The debian version still has some bugs (Wrong value in headersize and need to check the BMP structure).
Download the source from the GitHub here.
