Discussion Forums

Membrane switch with blend micro


I am using a membrane switch to activate a led, but the led is turning on randomly.

From what I learned via videos, this is caused by the pin floating. Not being 0 or 1.
Does the blend micro have a internal resistor or do I need a external resistor to pull down the pin?

Kind regards,


Hi @binsento, you can set the input pin to be input pull down:

void setup() {
  pinMode(pin, INPUT);
  digitalWrite(pin, LOW);



When I use the given code it doesn’t help, it still turns on and off randomlly. Or am i not using the above code not correctly. As i only implemented that piece of code and didn’t change anything in the button example.


I found a way around it, instead of using the 3.3 volts from the MC instead i connect the switch to ground and to the pins. And when it reads low it flashes the LED.


So you have got the problem resolved?


Yes my problem as being solved.