Do pins 11,12 work for pinMode INPUT_PULLUP?
I have the code in a loop using various pins 10-12, 26, 29, 32-35, 40. But only pins 11, and 12 do not work
simplified the code would look like this:
The actual code is:
So either pins 11,12 do not work or it's a hardware issue. However no way it's a hardware issue. I'm using a continuity tester and I can verify that the circut opens and closes as expected.
Help!
I have the code in a loop using various pins 10-12, 26, 29, 32-35, 40. But only pins 11, and 12 do not work
simplified the code would look like this:
Code:
setup() {
pinMode(11, INPUT_PULLUP);
}
void loop() {
sw3.bounce.update();
if(sw3.bounce.fallingEdge()) {
Serial.println("11");
}
}
The actual code is:
Code:
const int NUM_SWITCHES = 12;
SwitchInfo switches[NUM_SWITCHES] = {
SwitchInfo("SWITCH_INCREASE", 33, DEBOUNCE_SWITCH, KEYBOARD, "Y", 0, 0, 0, 0), //S1 working
SwitchInfo("SWITCH_DECREASE", 34, DEBOUNCE_SWITCH, KEYBOARD, "Z", 0, 0, 0, 0), //S2 working
SwitchInfo("SWITCH_PREVIOUS", 11, DEBOUNCE_SWITCH, KEYBOARD, "1", 0, 0, 0, 0), //S3 FAILS!!!
SwitchInfo("SWITCH_NEXT", 12, DEBOUNCE_SWITCH, KEYBOARD, "2", 0, 0, 0, 0), //S4 FAILS!!!
SwitchInfo("ROTARY_SVG_WIDTH_CLICK", 18, DEBOUNCE_ROTARY_SWITCH, KEYBOARD, "C", 0, 0, 0, 0), //E1 working
SwitchInfo("ROTARY_VIEWBOX_WIDTH_CLICK", 15, DEBOUNCE_ROTARY_SWITCH, KEYBOARD, "F", 0, 0, 0, 0), //E2 working
SwitchInfo("ROTARY_SVG_Y_CLICK", 35, DEBOUNCE_ROTARY_SWITCH, KEYBOARD, "I", 0, 0, 0, 0), //E3 working
SwitchInfo("ROTARY_VIEWBOX_Y_CLICK", 40, DEBOUNCE_ROTARY_SWITCH, KEYBOARD, "L", 0, 0, 0, 0), //E4 working
SwitchInfo("ROTARY_VIEWBOX_HEIGHT_CLICK", 29, DEBOUNCE_ROTARY_SWITCH, KEYBOARD, "O", 0, 0, 0, 0), //E5 working
SwitchInfo("ROTARY_SVG_HEIGHT_CLICK", 32, DEBOUNCE_ROTARY_SWITCH, KEYBOARD, "R", 0, 0, 0, 0), //E6 working
SwitchInfo("ROTARY_VIEWBOX_X_CLICK", 26, DEBOUNCE_ROTARY_SWITCH, KEYBOARD, "U", 0, 0, 0, 0), //E7 working
SwitchInfo("ROTARY_SVG_X_CLICK", 10, DEBOUNCE_ROTARY_SWITCH, KEYBOARD, "X", 0, 0, 0, 0) //E8 working
};
void setup() {
Serial.begin(9600);
for (int i = 0; i < NUM_SWITCHES; i++) {
pinMode(switches[i].pin, INPUT_PULLUP);
}
}
void loop() {
for (int i = 0; i < NUM_SWITCHES; i++) {
switches[i].bounce.update();
if (switches[i].bounce.fallingEdge()) {
Serial.println(String("fallingEdge Switch SingleCharPrint switch i:") + i);
}
}
So either pins 11,12 do not work or it's a hardware issue. However no way it's a hardware issue. I'm using a continuity tester and I can verify that the circut opens and closes as expected.
Help!