Pinguino Forum
Input HIGH with no connection - Printable Version

+- Pinguino Forum (http://forum.pinguino.cc)
+-- Forum: General (http://forum.pinguino.cc/forumdisplay.php?fid=5)
+--- Forum: Frequently-Asked Questions (http://forum.pinguino.cc/forumdisplay.php?fid=9)
+--- Thread: Input HIGH with no connection (/showthread.php?tid=4994)



Input HIGH with no connection - nolash - 27-08-2018

When trying to read a pin set with pinMode(n, INPUT), I sometimes get HIGH readings on itĀ even though I have nothing connected to it. Is this to be expected?


RE: Input HIGH with no connection - pingotg - 28-08-2018

It's not safe to leave an input floating/unconnected (unless it's a pin with an enabled internal pullup) - it can cause damage to the chip as well as causing unpredictable readings.

It's worth reading the chip's datasheets, which usually contain warnings about many things including probably this one..

John


RE: Input HIGH with no connection - nolash - 28-08-2018

I see. The intention was to have a debug switch, kind of like a jumper. Some code would be executed only if the pin was high, and which could be changed manually while the routine is still running. How could something like this be achieved?


RE: Input HIGH with no connection - pingotg - 30-08-2018

Tie it high or low via a resistor or two and short one out with the jumper/switch - there are examples online if you look.

Read the datasheet to see which is the right way to choose.

John