I'm using the arduino with ATmega168
I connected a Touch Sensor Motorola MPX200D to it (1ste pin on GND, 2th on 5V, 3th on Input 0.
Now I used
int ledPin = 13; // LED connected to digital pin 13
int presSensor = 0;
int val = 0;
int TRESHOLD = 512;
void setup()
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
beginSerial(9600);
}
void loop()
{
val = analogRead(presSensor);
if (val >= TRESHOLD) {
printInteger(val);
printString(" push ");
digitalWrite(ledPin, HIGH);
} else {
printInteger(val);
printString(" ");
digitalWrite(ledPin, LOW);
}
delay(2000); // we have to make a delay to avoid overloading the serial port
}
Now the values are all the same (242 or 243), when I touch the sensor or when I don't touch it.
Normally the values should change when I touch it, or am I wrong?