Go Down

Topic: strange behavior of a qprox (Read 327 times) previous topic - next topic

nbuechi

hy,

i'm working with a qt110 chip.


so, when i try to read it just normal with the analog input tutorial, everything is fine. i check out the serial monitor, and i see the right values rollin. 1024 if no touch, 0 when i touch it.


but as i built it into my program, i never get a clear value. and the value, that it reads changes very oftly. here my reading function:

[font=Courier]void position(){
 int links;
 int rechts;
 links = analogRead(linkerPin);
 rechts = analogRead(rechterPin);
Serial.println(links);
 if(links < 500){
   if(positionValue < 64){
     int neuePos = positionValue << 1;
     positionValue = neuePos;
   }
 }

 if(rechts < 500){
   if(positionValue > 1){
     int neuePos = positionValue >> 1;
     positionValue = neuePos;[/font]
   }
 }
}



how can it be? is there something in general i have forgotten? any suggestions?


thanks for any reply
nicolas

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy