Code completely rewritten. The new CapacitiveSensorDue library is an alternative library which is compatible with Arduino Due.