I have a Adafruit M0 Bluefruit LE that I'm having issues using with Momentary SPST buttons.
I don't think I have the wiring correct?
The exact SPST I have is this
I'm trying to get it to read 6. So my code has something like this in it
if (digitalRead(6)) == LOW {
Serial.print("Switch enabled");
}
But I don't see any changes in the pin status. Any pointers to how to wire this correctly and code it would be great.
Thanks!
You have a closing parentheses ) in the wrong location.
Does it even compile?
Oops, the code does compile. That was a typo on my part writing the question on the forum.
I think the underlying issue is that my wiring might be incorrect.
system
December 31, 2018, 5:02am
5
Wire one side of switch to pin 6, other side to GND, in setup() put:
pinMode(6,INPUT_PULLUP);
Actually, the problem was the header pins and the breadboard. Seems like the header pins were not making proper contact with the board, there by not completing any of the circuit.
Anyhow, it works fine now. Thanks for the help.