2

Im trying out this membrane from Adafruit that i bought last week but i have a little issue. ITS SO SENSITIVE! i as so just touch it with my finger and it transmits!. Anyone that has worked with this membrane have the same issue? is there some sort of "fix"?

UPDATE

Its really simple. But one weird thing, not sure if its supposed to be like that, but by default, the buttons are on HIGH. i used Serial.println(digitalRead(one)); to verify that and the output was 1.

int two =  8;
int one = 9;
int four = 10;
int three = 11;

void setup() {
  pinMode(one, INPUT);
  pinMode(two, INPUT);
  pinMode(three, INPUT);
  pinMode(four, INPUT);
  Serial.begin(9600);
}

void loop() {
  if(digitalRead(one) == LOW){
    Serial.println("One");
  }else if(digitalRead(two) == LOW){
    Serial.println("Two");
  }else if(digitalRead(three) == LOW){
    Serial.println("Three");
  }else if(digitalRead(four) == LOW){
    Serial.println("Four");
  }
}
xR34P3Rx
  • 123
  • 4

1 Answers1

4
pinMode(one, INPUT);

You have configured the input with no pullup. Since it is a CMOS input and hence very high impedance, it effectively acts as an antenna picking up random signals including that of your finger becoming capacitively coupled to it. You must enable the pullup on the pins (and connect the common to ground) if you want correct operation.

 pinMode(one, INPUT_PULLUP);
Ignacio Vazquez-Abrams
  • 17,663
  • 1
  • 27
  • 32