Your SlideShare is downloading. ×
0
Three Easy Pieces For The TouchShield
Three Easy Pieces For The TouchShield
Three Easy Pieces For The TouchShield
Three Easy Pieces For The TouchShield
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Three Easy Pieces For The TouchShield

2,344

Published on

A little presentation about the different ways to program the TouchShield Stealth and Slide. There's a beginner, intermediate, and advanced "level", but really the major difference is how optimized …

A little presentation about the different ways to program the TouchShield Stealth and Slide. There's a beginner, intermediate, and advanced "level", but really the major difference is how optimized the code will be...

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
2,344
On Slideshare
0
From Embeds
0
Number of Embeds
19
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Three easy pieces: 3 ways to program the TouchShield Advanced
    • TouchShield low level graphics drawing functions
    • Arduino code optional, may not even be needed at all
    • TouchShield contains full graphics program, with touch screen providing I/O
    • May use low level C macros to optimize pixel drawing
    • OLED hardware function calls let you access bit and pixel-level optimizations like testing whether a certain pixel is set
    Intermediate
    • TouchShield runs its own program
    • Arduino runs its own program
    • Arduino and TouchShield communicate with each other over serial when they need to share data
    • Uses SubProcessing calls on the TouchShield
    • Arduino spends most of its time polling I/O and sending values up to the TouchShield (like from the InputShield)
    Beginner
    • TouchShield programmed with SubProcessing, acting like a canvas
    • Arduino generates serial function calls and sends commands to the TouchShield
    • TouchShield acts like a canvas for SubProcessing, a subset of the Processing Graphics language
    • Arduino sends serial drawing commands
    • Display speeds as fast as a serial connection (e.g. 9600 baud)
    1 2 3
  • 2. The easiest way is to use the TouchShield as a SubProcessing graphics canvas Beginner
    • TouchShield programmed with SubProcessing, acting like a canvas
    • Arduino generates serial function calls and sends commands to the TouchShield
    • TouchShield acts like a canvas for SubProcessing, a subset of the Processing Graphics language
    • Arduino sends serial drawing commands
    • Display speeds as fast as a serial connection (e.g. 9600 baud)
    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. To get more speed and flexibility, write separate programs for the TouchShield and Arduino Intermediate
    • TouchShield runs its own program
    • Arduino runs its own program
    • Arduino and TouchShield communicate with each other over serial when they need to share data
    • Uses SubProcessing calls on the TouchShield
    • Arduino spends most of its time polling I/O and sending values up to the TouchShield (like from the InputShield)
    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. And to really push the limits, go down into the OLED hardware functions of the TouchShield... Advanced
    • TouchShield low level graphics drawing functions
    • Arduino code optional, may not even be needed at all
    • TouchShield contains full graphics program, with touch screen providing I/O
    • May use low level C macros to optimize pixel drawing
    • OLED hardware function calls let you access bit and pixel-level optimizations like testing whether a certain pixel is set
    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!

×