Qwiic Switch and Toggles

https://i.imgur.com/1yfuRYL.png

This seems to work just fine (yay!) but I’m noticing two things:

  1. I don’t think I need to use the GND next to the LED pin as it seems to be internally grounded. Is that right?

  2. When I do light up the LED, it flickers. I think that’s due to the brightness setting? Is there a way (full brightness) to stop that?

See code here: https://gist.github.com/kfrancis/c4c4a2 … 3987c4bc28

Here’s a drawing of the internal wiring on the switch. The way you have it connected, it looks like you’re shorting the LED output pin when the switch is turned on and that might be causing the flickering you’re seeing.

I do notice that when it’s connected the way I had it, that I’m seeing it constantly switch on/off - does that make sense with what you’ve described? Is there a solution?

It’s possible current drawn through the LED might be interfering with the boards ability to correctly sense the state of the switch. Have you tried disconnecting the LED to see if the problems go away? You may need to use a different switch that has the LED separate from the switch. Something similar to [COM-11971 should work.](Metal Pushbutton - Latching (16mm, Red) - COM-11971 - SparkFun Electronics)

In the end I needed to connect the LED pin to ground. I lose the LED, but the switch function works now.