Hello!
I feel like I'm missing something here and cannot seem to figure out where I'm going wrong. I have a Mini 8-Way Rotary Selector Switch connected to my Pro Micro and as a proof of concept have confirmed that it is working as expected. I am running QMK and plan on using the switch for layer selection, but for now, it's just outputting numbers so I can validate that it's working. My code looks as follows:
/* define DIP switch pins for rotary switch */
#define DIP_SWITCH_PINS { B3, B2, B6, D7, E6 }
and later for handling:
bool dip_switch_update_user(uint8_t index, bool active) {
switch (index) {
case 0: {
if (active) {
tap_code16(KC_1);
} else {
}
break;
}
case 1: {
if (active) {
tap_code16(KC_2);
} else {
}
break;
}
case 2: {
if (active) {
tap_code16(KC_3);
} else {
}
break;
}
case 3: {
if (active) {
tap_code16(KC_4);
} else {
}
break;
}
case 4: {
if (active) {
tap_code16(KC_5);
} else {
}
break;
}
}
return true;
}
The issue I'm running into is that I'm trying to save as many pins as possible (the board is already a 5x4 switch matrix with the SP8T), while also trying to add LED indicators to the 8-way to show which layer is active. I do know that I can run each LED to pin and set high state as needed, but that requires more pins than I have available. I've tried connecting the LEDs as follows:
This works, but the LED remains on until you're on the selection, which turns it off. Is there any way to reverse this? So the LED is only on when the switch is active?