Three easy pieces: 3 ways to program the TouchShield Advanced <ul><li>TouchShield low level graphics drawing functions </l...
The easiest way is to use the TouchShield as a  SubProcessing  graphics canvas Beginner <ul><li>TouchShield programmed wit...
To get more speed and flexibility, write separate programs for the TouchShield and Arduino Intermediate <ul><li>TouchShiel...
And to really push the limits, go down into the OLED hardware functions of the TouchShield... Advanced <ul><li>TouchShield...
Upcoming SlideShare
Loading in …5
×

Three Easy Pieces For The TouchShield

768 views

Published on

This is a little description of how to program on the TouchShield... beginning, intermediate, and advanced... though the real difference is how much optimization and how low level on the graphics the functions get...

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
768
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Three Easy Pieces For The TouchShield

  1. 1. Three easy pieces: 3 ways to program the TouchShield Advanced <ul><li>TouchShield low level graphics drawing functions </li></ul><ul><li>Arduino code optional, may not even be needed at all </li></ul><ul><li>TouchShield contains full graphics program, with touch screen providing I/O </li></ul><ul><li>May use low level C macros to optimize pixel drawing </li></ul><ul><li>OLED hardware function calls let you access bit and pixel-level optimizations like testing whether a certain pixel is set </li></ul>Intermediate <ul><li>TouchShield runs its own program </li></ul><ul><li>Arduino runs its own program </li></ul><ul><li>Arduino and TouchShield communicate with each other over serial when they need to share data </li></ul><ul><li>Uses SubProcessing calls on the TouchShield </li></ul><ul><li>Arduino spends most of its time polling I/O and sending values up to the TouchShield (like from the InputShield) </li></ul>Beginner <ul><li>TouchShield programmed with SubProcessing, acting like a canvas </li></ul><ul><li>Arduino generates serial function calls and sends commands to the TouchShield </li></ul><ul><li>TouchShield acts like a canvas for SubProcessing, a subset of the Processing Graphics language </li></ul><ul><li>Arduino sends serial drawing commands </li></ul><ul><li>Display speeds as fast as a serial connection (e.g. 9600 baud) </li></ul>1 2 3
  2. 2. The easiest way is to use the TouchShield as a SubProcessing graphics canvas Beginner <ul><li>TouchShield programmed with SubProcessing, acting like a canvas </li></ul><ul><li>Arduino generates serial function calls and sends commands to the TouchShield </li></ul><ul><li>TouchShield acts like a canvas for SubProcessing, a subset of the Processing Graphics language </li></ul><ul><li>Arduino sends serial drawing commands </li></ul><ul><li>Display speeds as fast as a serial connection (e.g. 9600 baud) </li></ul>1 TouchShield Arduino void setup(void){ } void loop(void){ beginCanvas(); } void setup(void){ mySerial.begin(9600); background(0); fill(0); stroke(255,0,0); } void loop(void){ rect(10,10,25,25); } When you want to write a sketch, just change the Arduino's program
  3. 3. To get more speed and flexibility, write separate programs for the TouchShield and Arduino Intermediate <ul><li>TouchShield runs its own program </li></ul><ul><li>Arduino runs its own program </li></ul><ul><li>Arduino and TouchShield communicate with each other over serial when they need to share data </li></ul><ul><li>Uses SubProcessing calls on the TouchShield </li></ul><ul><li>Arduino spends most of its time polling I/O and sending values up to the TouchShield (like from the InputShield) </li></ul>2 TouchShield Arduino void setup(void){ Serial.begin(9600); } void loop(void){ buttonValue = Serial.read(); if (buttonValue) rect(10,10,25,25); } AFSoftSerial mySerial = AFSoftSerial(RXPIN, TXPIN); void setup(void){ mySerial.begin(9600); } void loop(void){ serial_sendDigital(getInputShieldButton(1)); } When you want to write a sketch, change the graphics on the TouchShield, and the base program on the Arduino
  4. 4. And to really push the limits, go down into the OLED hardware functions of the TouchShield... Advanced <ul><li>TouchShield low level graphics drawing functions </li></ul><ul><li>Arduino code optional, may not even be needed at all </li></ul><ul><li>TouchShield contains full graphics program, with touch screen providing I/O </li></ul><ul><li>May use low level C macros to optimize pixel drawing </li></ul><ul><li>OLED hardware function calls let you access bit and pixel-level optimizations like testing whether a certain pixel is set </li></ul>3 TouchShield Arduino void setup(void){ } void loop(void){ LCD_CTRL_PORT |= (1 << LCD_WR); LCD_DATA_MED_DDR = 0x00; } void setup(void){ } void loop(void){ } Have fun!

×