Adding a switch to the DinMeter
-
I am trying to add an external switch to the DinMeter, but am having trouble reading the stitch closure. If I prototype this on an Arduino Uno, I have no issues and it works as expected. Is there a chance that I'm not calling the proper pin? I am trying to use G1 on PortB as I suspect that is the proper one. Or is there a chance that I can't do a digitalRead on that pin for the switch to work?
int switchPin = G1;
int switchValue = 0;void setup() {
pinMode(switchPin, INPUT_PULLUP);
}void loop() {
if (switchValue = digitalRead(switchPin) == LOW) {
do something...
}
}Thanks.
-
In case anyone else comes across this post, it appears that the wires coming out of the DinMeter PortB are reversed to the label, at least on my unit. G1 is the yellow wire, and G2 is the white one. It works as expected to do a digital read on the pins for a button push.
-
In case anyone else comes across this post, it appears that the wires coming out of the DinMeter PortB are reversed to the label, at least on my unit. G1 is the yellow wire, and G2 is the white one. It works as expected to do a digital read on the pins for a button push.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login