Troubleshooting

Posted on
  • >digitalWrite(A4,1);
    =undefined
    >digitalRead(A4);
    =0
    >pinMode(A4, "input_pulldown");
    =undefined
    >digitalWrite(A4,1);
    =undefined
    >digitalRead(A4);
    =0
    >pinMode(A4, "input_pullup");
    =undefined
    >digitalWrite(A4,1);
    =undefined
    >digitalRead(A4);
    =0
    >
    
  • What's connected to A4? Could it be shorted to ground?

  • So the issue is that the last digitalRead should return 1? As discussed in another thread on here very recently, it's not a massive surprise that the first digitalRead returns 0, as before you call pinMode, digitalRead will make sure the pin is an input, which would make the voltage on it more or less random.

    Is A4 connected to anything? Which board are you using, and do you have up to date firmware?

  • Just tried it here and it works fine for me.

  • I have to date firmware and A4 is connected to a diode. I'm using this board: http://www.espruino.com/EspruinoBoard

  • All good in the hood, thanks guys!

  • Was the diode connected to GND on the other side?

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Troubleshooting

Posted by Avatar for user52526 @user52526

Actions