Simple hardware "hint" or "breadcrumb" as alternative to DIP switch

boron
Tags: #<Tag:0x00007fe21fe5a728>

#1

I’m looking for a super-small / easy way to leave a hint on the proto-board that I attach my Boron to. The hint, if there, would indicate to the firmware to do X, and if not there to do Y. One idea I had was to tie two digital pins together, run one as OUT and one as IN. Set OUT to HIGH, if IN goes HIGH then X, else Y. Would love to hear other ideas.


#2

Why would you sacrifice a pin as output? A bridge to the 3.3V rail on an INPUT_PULLDOWN pin or GND to an INPUT_PULLUP should do.

The shortest bridge would be GND-A0 with pinMode(A0, INPUT_PULLUP).


#3

I would have to say the absolute easiest way has got to be what @ScruffR suggested. There are several other ways to do the same thing but this has got to be the most simplistic approach. And not sacrificing any digital pins. However you could pull of the same thing with a digital pin if you don’t want to use an analog pin.


#4

If you have no spare IO then an I2C four port expander - with each of the 4 ports hardwired to either +3v3 or 0v - you can get 16 device “hints”…