Go Down

Topic: Native Capacitive Touch - Arduino Nano (Read 1 time) previous topic - next topic

fkeel


Hi Everyone

I am playing around with the native capacitive touch function I found here: http://playground.arduino.cc//Code/CapacitiveSensor

I am using an arduino Nano with 8 analogue Inputs. For A6 and A7 the only reading I get is 17. The two pins appear to simply do nothing at all. I guess this might be an issue of the portmanipulation and bit-math which is going on in the function, but its really beyond my programming skills.

Does anyone know what the problem might be and how to fix it?

Thanks

p.
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

fkeel

here is my code, though I doubt that is the issue:

Code: [Select]


void setup() {
 Serial.begin(9600);
}


void loop() {
 
 Serial.print(readCapacitivePin(A0));
 Serial.print(", ");
   Serial.print(readCapacitivePin(A1));
   Serial.print(", ");
   Serial.print(readCapacitivePin(A2));
  Serial.print(", ");
   Serial.print(readCapacitivePin(A3));
 Serial.print(", ");
   Serial.print(readCapacitivePin(A4));
 Serial.print(", ");
   Serial.print(readCapacitivePin(A5));
 Serial.print(", ");
   Serial.print(readCapacitivePin(A6));
 Serial.print(", ");
   Serial.print(readCapacitivePin(A7));
 Serial.println("");
 
 

 delay(1);        // delay in between reads for stability
}



The output on my serial console looks something like this:

Code: [Select]
2, 2, 1, 2, 2, 1, 17, 17
2, 2, 1, 2, 2, 1, 17, 17
2, 2, 1, 2, 2, 1, 17, 17
2, 2, 1, 2, 2, 1, 17, 17
2, 2, 1, 1, 2, 1, 17, 17
2, 2, 1, 2, 2, 1, 17, 17
2, 2, 1, 1, 2, 1, 17, 17
2, 2, 1, 1, 2, 1, 17, 17
2, 2, 1, 1, 2, 1, 17, 17
2, 2, 1, 1, 2, 1, 17, 17
2, 2, 1, 1, 2, 1, 17, 17
2, 2, 1, 1, 2, 1, 17, 17


If I touch a sensor, it looks like this:

Code: [Select]
2, 2, 1, 9, 2, 1, 17, 17
2, 2, 1, 9, 2, 1, 17, 17
2, 2, 1, 10, 2, 1, 17, 17
2, 2, 1, 8, 2, 1, 17, 17
2, 2, 1, 9, 2, 1, 17, 17
2, 2, 1, 10, 2, 1, 17, 17
2, 2, 1, 9, 2, 1, 17, 17
2, 2, 1, 6, 2, 1, 17, 17
2, 2, 1, 9, 2, 1, 17, 17
2, 2, 1, 7, 2, 1, 17, 17
2, 2, 1, 9, 2, 1, 17, 17
2, 2, 1, 8, 2, 1, 17, 17
2, 2, 1, 7, 2, 1, 17, 17
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

RIDDICK

pins A6 and A7 r no digital pins, IIRC...
they r just connected to the ADC MUX...
-Arne

fkeel

Brunsbuettel... wie schoen :-D

Yep - I was afraid of that. I didnt realize those two pins dont work that way until I had all my project soldered and cabled :-S .... if I had known in advance, I would have just used a mega. oh well...
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

RIDDICK

u can use other pins?
or did u already use them all?
-Arne

fkeel

wait. they dont need to be analogue pins, do they ... maybe I can :-D *facepalm*
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

RIDDICK

-Arne

Go Up