By doing this
pinMode(button,INPUT);
digitalWrite(button,HIGH);
you have turned on the internal pullup resistor of the processor which will normally keep the input pin HIGH
How is the button wired ?
By doing this
pinMode(button,INPUT);
digitalWrite(button,HIGH);
you have turned on the internal pullup resistor of the processor which will normally keep the input pin HIGH
How is the button wired ?