Unused analog pins return a random value on analogRead but I want them to all return zero.Besides hooking the unused analog pins to ground, is there any other way to have analogRead return zero? Perhaps a software solution that can be implemented in code?
That works fine and dandy for a digital pin, but I would think that being able to apply the same principle to an analog pin (steering an input pin to a known state when there's no input) would be a useful feature?
Others may rearrange, add, or subtract sensors to different pins. I'm hoping there is a way to avoid having them also remember to attach unused pins to common ground. It would be easier to just have them plug sensors in and not have to worry about anything else.
Added a resistor of like ~148K to ground and now it works beautifully to detect any empty pins and it still returns exactly the right values when the sensors are plugged in. A 10K resistor wasn't enough and still gave a reading in the 780 range, so I bumped it higher.