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.