//basic implementation of Paul Badgers Capacitive Sensing Library 
//http://playground.arduino.cc/Main/CapacitiveSensor

#include <CapacitiveSensor.h> //import the capsense library
#define touchPin1 5 //define the two pins to use as the sensor. (a 100k resistor goes between them, lower values = less sensitivity)
#define touchPin2 6

CapacitiveSensor touchSensor = CapacitiveSensor(touchPin1, touchPin2); //setup the touch sensor between our two pins

void setup()                    
{
  Serial.begin(9600); //start hardware serial for feed back
  touchSensor.set_CS_Timeout_Millis(4000); //enable time out after 4 seconds to prevent script from hanging.
}

void loop()                    
{
    long sensedValue =  touchSensor.capacitiveSensor(80); //sample 80 values and return the average
    Serial.println(sensedValue);           //print the value out our serial line      
    delay(10);                             //pause slightly then take another reading
}
