This document is intended to help programers that want to program the LiquidWare TouchShield Stealth and TouchShield slide.
The first thing to understand is that both the TouchShield (128 x 128) and the TouchSlide (320 x 240) have their own Atmel processors. They both are fully Arduino complient and can be easily programmed in their own right as apposed to a display for the Arduino that they are plugged into.
Below is a comparison of the 2 dispays.
|Size (Pixels)||128 x 128||320 x 240|
|Size (inches)||1.50 inch diagonal||3.00 inch diagonal|
|Technology||OLED - Organic LED|
|On board CPU||ATMEGA 645||ATMEGA 2560|
|Interface||Only Uses Arduino Pins: 2 and 3|
|Data Storage||16 megbit (2 megbyte) on board FLASH For storing images or data Holds 40 128 x 128 bitmap images ATMEL AT45DB161D chip|
|Colors||262K (6 bit-R 6 bit-G 6 bit-B)|
The demo programs (sketches) are demo_arduino.pde and demo_slide.pde. These 2 files establish a grpahics command protocol that the Arduino sends data to the Slide and it does the drawing. It works quite well except for the limitation of baud rate. The demos work at 9600 bps and it can be difficult to get softserial to work reliably above that.
As of this writting (January 2010) most customers are using the display as the boss and the arduino simply passes data from some place such as the input shield or the button shield. With Arduinos using the 128 or 328, that made sense. The TouchSlide has far more memory than either of them
I will be documenting both options.
Below is the programming style guidelines that I have used for 25 years of programming C, both for myself and for large corporations. I encourage programmers to use this style, it makes for much easier code to read.
These next few rules have to be broken to keep compatibility
The main issue is global variable names. Many global variable names have been changed due to confusion in the code. For example, the global variables width and height have been changed to gWidth and gHheight. This is for 2 reasons, first the variables width and height were used as argument names and as variable names within various routines. This makes it VERY difficult to know for sure what the original programmer wanted. The second reason is consistent programming style for clarity.
Earlier releases of the libraries had 2 separate libraires, one for the TouchShield and one for the TouchSlide. As of version 8.13 of the Antipasto release, the libraries are merged as one. The file Hardwaredef.h does the work of figuring out which unit is being compiled.
These options are found in the following files:
#define _ENABLE_HERSHEY_FONTS_comment out the line by putting "//" in front of the line
//#define _ENABLE_HERSHEY_FONTS_Here is a list of most of the current compile options. More details can be found in the various .h files.
|_ENABLE_LARGE_NUMBERS_||font.h||Larger fonts Numbers only||1138 bytes|
|_ENABLE_XLARGE_NUMBERS_||font.h||Very large fonts Numbers only||6974 bytes|
|_ENABLE_HERSHEY_FONTS_||font.h||Vector fonts, fully scalable.||base fonts and code 3984 bytes|
|_ENABLE_HERSHEY_GREEK_||HersheyFonts.h||One of many Hershey Fonts
There are many more fonts, refer to HersheyFonts.h
|_ENABLE_HERSHEY_GOTHIC_ENGLISH_||HersheyFonts.h||One of many Hershey Fonts||9752 bytes
|_ENABLE_TAHOMA_FONTS_||font.h||Fonts by TWH||20454 bytes|
|_ENABLE_SCREEN_ROTATION_||HardwareDef.h||The ability to put the screen in any of 4 orientations,||672 bytes|
|_ENABLE_PEN_TAP_||SubPGraphics.h||Pen tap and hold support (written by TWH)||379 bytes|
|_ENABLE_SMOOTHING_||SubPGraphics.h||Line smoothing (anti-aliasing) (written by TWH)||7784 bytes|
|_ENABLE_CLIPPING_||graphics.h||Window bounds clipping (By TWH)||686 bytes|
|_ENABLE_HARDWARE_SCROLL_||graphics.h||The TouchSlide has hardware scrolling capabilites|
|_ENABLE_TOUCHSHIELD_DEBUG_||SubPOptions.h||This allows you to do serial printing out the normal serial port thru the Arduino. It puts the Arduino into RESET, you can specify the baudrate.||120 bytes|
|_SUBP_OPTION_QUICKDRAW_||SubPOptions.h||Macintosh style function names|
|_SUBP_OPTION_7_SEGMENT_||SubPOptions.h||7 segment number display for clocks and calculators etc|
|_SUPPORT_OLD_LCD_ROUTINE_NAMES_||SubPOptions.h||Support the names of the original function calls in the first version of the library||602 bytes|
Here is my latest creation,