Skip to content

digitalRead on NodeMCU user switch #123

@hallard

Description

@hallard

Hi there,

I've got a NodeMCU board with a flash switch and a user switch. The user switch is set as follow

image

R3 is not populated and here the full schematic

My sketch is as follow

#include "ESP8266WiFi.h"

void setup() 
{
  Serial.begin(115200);
   pinMode(16, INPUT);
}
void loop() 
{
  Serial.print("GPIO16=");
  Serial.println(digitalRead(16));
}

As soon I launch it, GPIO16 is displayed as 1 on serial then I push the user switch, then GPIO16 is displayed as 0, and then GPIO16 never get back to 1 when I release the switch. Is there something I missed or it is related to internal hardware (I could not find a descent datasheet) ? Of course I also tried with INPUT_PULLUP with same results

Thank you for your help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions