Skip to content
Discussion options

You must be logged in to vote

That is a very reasonable question. You can use either wiring technique.

If you use the two-wire technique, the switch will leave the port in a disconnected, or "floating", state. In this state nothing is driving the port either high or low, so the signal will effectively be random. You'll need to use the Gizmo's internal pull-up resistors, which are activated through software. The exact method will depend on which programming language you are using.

In Arduino, when calling the pinMode function, set the mode to INPUT_PULLUP.

pinMode(switchPin, INPUT_PULLUP);

In CircuitPython, you can turn on the pull up resistor by setting the pull property on the digitalio object. Example:

switch = digi…

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
4 replies
@the-maldridge
Comment options

@jds-designs
Comment options

@barulicm
Comment options

@jds-designs
Comment options

Answer selected by jds-designs
Comment options

You must be logged in to vote
4 replies
@jds-designs
Comment options

@Vaelatern
Comment options

@barulicm
Comment options

@jds-designs
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants