The slide I'm refering to is the TouchShield Slide from Liquidware. This board only uses pins 2 and three.
The code I'm using is the demo software from Liquidware and is as follows:
//
// Two-way Serial Communications
//
// TouchShield Slide <-> Arduino
//
// An open-souce Shadowlord Project
//
www.IamShadowlord.com//
/////////////////////////////////////////
// Code for Arduino //
/////////////////////////////////////////
#include <AFSoftSerial.h>
#define RX_PIN 3
#define TX_PIN 2
AFSoftSerial touchSerial = AFSoftSerial(RX_PIN, TX_PIN);
// Globals
long randNumber;
void setup()
{
touchSerial.begin(9600);
}
void loop()
{
randNumber = random(300);
if(touchSerial.available())
{
char c = (char)touchSerial.read();
if (c == 'A')
{
touchSerial.print(randNumber);
delay(100);
}
}
}
//
// Two-way Serial Communications
//
// TouchShield Slide <-> Arduino
//
// An open-souce Shadowlord Project
//
www.IamShadowlord.com//
/////////////////////////////////////////
// Code for TouchShield Slide //
/////////////////////////////////////////
// Globals
unsigned int Xstore;
unsigned int Ystore;
void setup() // Prepare Screen and Serial
{
background(0,0,0);
stroke(255,255,255);
fill(0,0,0);
Serial.begin(9600);
delay(100);
}
void loop()
{
gettouch(); // Monitor TouchShield Slide for touches
if ( mouseX != Xstore || mouseY != Ystore ) // If new touches, send serial command to Arduino
{
Serial.print("A");
delay(50);
}
Xstore = mouseX;
Ystore = mouseY;
char charIn = 0; // Monitor Serial Buffer of TouchShield Slide
byte i = 0;
char stringIn[32] = "";
while(Serial.available())
{
charIn = Serial.read();
stringIn
= charIn;
i += 1;
}
if (stringIn[0]) // Clear screen and display the serial buffer as text
{
background(0,0,0);
text(stringIn, mouseX+75, mouseY+75, 30, 30);
}
}
Hope this helps toward a resolution. Thanks in advance
Doug