NodeMCU - running arduino - User Button
Posted: Tue Jun 23, 2015 12:51 pm
Hi
I notice there is a user button connected to GPIO 16 on the nodeMCU hardware (physical button bottom left)
I have set my code as follows
Now when the script runs it shows Pin16=1
If I click the button it then shows Pin16=0 and a little blue lamp shines brightly.
When I let the button go the Pin16 remains at 0 and the little blue light shines dimly.
How am I supposed to use this button?
If I change the pinMode to
It then just displays 0 all the time.
I notice there is a user button connected to GPIO 16 on the nodeMCU hardware (physical button bottom left)
I have set my code as follows
Code: Select all
void setup()
{
Serial.begin(115200);
pinMode(16, INPUT);
}
void loop() {
Serial.print("Pin16=");
Serial.println(digitalRead(16));
delay(1000);
}
Now when the script runs it shows Pin16=1
If I click the button it then shows Pin16=0 and a little blue lamp shines brightly.
When I let the button go the Pin16 remains at 0 and the little blue light shines dimly.
How am I supposed to use this button?
If I change the pinMode to
Code: Select all
pinMode(16, INPUT_PULLDOWN);
It then just displays 0 all the time.