On ESP8266 nodeMCU 12E the pin D8 always shows '0'
Posted: Mon Nov 26, 2018 8:51 am
I have wrote the very simple sketch to just view the pin output without any load with this simple programme on ESP8266 nodeMCU 12e. On the D8 pin always get the value '0' any idea. If I connect the pin D8 with a 10K load and connect with USB to upload the sketch its give an error and do not upload the sketch. Any idea why? my sketch is attached.
Code: Select all
int p_D0 = D0;
int p_D1 = D1;
int p_D2 = D2;
int p_D3 = D3;
int p_D4 = D4;
int p_D5 = D5;
int p_D6 = D6;
int p_D7 = D7;
int p_D8 = D8;
void setup()
{
Serial.begin(9600);
pinMode(p_D0, INPUT);
pinMode(p_D1, INPUT);
pinMode(p_D2, INPUT);
pinMode(p_D3, INPUT);
pinMode(p_D4, INPUT);
pinMode(p_D5, INPUT);
pinMode(p_D6, INPUT);
pinMode(p_D7, INPUT);
pinMode(p_D8, INPUT);
}
void loop()
{
int p_D0_st = digitalRead(p_D0);
int p_D1_st = digitalRead(p_D1);
int p_D2_st = digitalRead(p_D2);
int p_D3_st = digitalRead(p_D3);
int p_D4_st = digitalRead(p_D4);
int p_D5_st = digitalRead(p_D5);
int p_D6_st = digitalRead(p_D6);
int p_D7_st = digitalRead(p_D7);
int p_D8_st = digitalRead(p_D8);
Serial.print(p_D0_st);
Serial.print(p_D1_st);
Serial.print(p_D2_st);
Serial.print(p_D3_st);
Serial.print(p_D4_st);
Serial.print(p_D5_st);
Serial.print(p_D6_st);
Serial.print(p_D7_st);
Serial.print(p_D8_st);
Serial.print("\n-----------------\n");
delay(1000);
}