INPUT_PULLUP, but NOT got the HIGH signal

Hi Guys,

I just installed below code on setup function
pinMode(D4, INPUT_PULLUP);
pinMode(D5, INPUT_PULLUP);
pinMode(D7, INPUT_PULLUP);
pinMode(D6, INPUT_PULLUP);

But it was running out 0,1,0,1 accordingly when called :
digitalRead(D4);
digitalRead(D5);
digitalRead(D6);
digitalRead(D7);

where is the mistake should got this kinds of issue ? my hardware pullup resister broken ?
I am fresher for hardware programming .

thanx all for the support.

Seems the Pin4 & Pin 7 have been damaged before… If so , can i use the anolog pin instead ? how ?

Sorry to hear of the demise of your pins :anguished:

Are they completely dead or can you still e.g. digitalWrite(D7, HIGH) to turn on the blue LED?
To test digitalRead() capability you could just connect a digitalWrite pin to D4/D7 and check the readings when you toggle the output pin.
Hopefully you haven’t killed them completely :wink:

But for your question, you’d use the A-pins just the same as the D-pins.

1 Like

Hi ,ScruffR,

Thx your reply , and I am sure now , the D4 & D7 are both killed in my hard work before, (in some midnight , almost sleep, still, was facing the hug complex circuit ,i just picked up a 220V AC wire, wired and wired again, suddenly, i smelled some burning smell…)
:blush:

Yes, i am now using A pins instead,

Please be careful when working with high-voltage AC/DC!!! As you have discovered high voltage AC/DC should never connect directly to a microcontroller!

2 Likes