TouchShield Description
The Liquidware TouchShield and TouchSlide are add on shields for the Arduino family of processors. They are both fully compatible with the Arduino development environment. A full graphics library is provided to draw lines, colors, shapes and images on the screen. The library is compatible with the Processing graphics language and an Mac QuickDraw style command set is in the works
Software API Reference
Processing is the language of the TouchShield as programmed through the Arduino Environment Windows and Mac. See the software download section to grab the IDE.
Gadget
Serial
beginCanvas() – Accept drawing functions from the Arduino
delay() – Delay for a passed millisecond amount of time
random() – Generates a random number (long number)
Input
Touchscreen
gettouch() – Check the touch screen for a press at a pixel location
mouseX – Stored variable when “gettouch()” is called (X location of press)
mouseY – Stored variable when “gettouch()” is called (Y location of press)
touch_get_cursor() – old style single press
touch_calibrate() – Reset the previous calibration and prompt a recalibration
Shape
2D Primitives
ellipse() – Draws an ellipse of a user specified size and location
line() – Draw a line from point to point
point() – Draw a single pixel
rect() – Draw a rectangle with a specified beginning point, width and height
triangle() – Draw a triangle with three specified points
quad() – Draw a polygon with 4 specified lines from 4 specified points
size() – for clipping shapes
new for version 1.1.1
bezeir() draw a bezeir curve
arc() draw a partial circle/ellipse from start angle to end angle
Color
Setting
background() – Color the whole screen any of 16,777,216 different colors
fill() – Sets the color used to fill the inside shapes
nofill() – Will allow a shape to be drawn with nothing filled in the inside
stroke() – Sets the color of shape outlines or text
noStroke() – Allows a shape to be drawn without an outline drawn
strokeWeight() – changes the outline thickness of an ellipse or rectangle
Image Uploading
open(FlashTransfer) – The TouchShield will wait in this function till an image is uploaded to the device
loadImage(”.bmp”) – refers to an image store on the flash chip
image(loadImage(”.bmp”),0,0) – Paints the image at point 0,0
PImage – Define an image as a variable
Blog Demo
Typography
text() – for printing char[], int, long, and float types to the screen
Simple Example
MikeExample – getting started with my stealth and slide
Hardware Description
Pins – Explains what pins the TouchShield uses on the Arduino
TouchShield Slide:
Low level pin register descriptions
Low Level Functions
HersheyDrawCString() Draw vector font based on Hershey font data. Scaling and rotating supported, pen size not.
If you have questions or need any additions to these routines, please email msproul@jove.rutgers.edu
| TouchShield | TouchSlide |
|---|
| Size (Pixels) | 128×128 | 320×240 |
|---|
| Size (inches) | 1.50 inch diagonal | 3.00 inch diagonal |
|---|
| Technology | OLED – Organic LED |
|---|
| On board CPU | ATMEGA 645 | ATMEGA 2560 |
|---|
| Program Memory | 64K | 256K |
|---|
| Interface | Only Uses Arduino Pins: 2 and 3 |
|---|
| Data Storage | 16 megbit (2 megbyte) on board FLASH For storing images or dataHolds 40 128×128 bitmap images ATMEL AT45DB161D chip |
|---|
| Colors | 62K (6 bit R G B) |
|---|