Mapping GPIO to layer not working for me

I’m stumped.

As shown, the two items ticked for just layer one, do not trigger. I’ve tried scaling GPIO 19 as 1, 0 and -1 to no avail.

Without the first (GPIO 19) entry, and with all the other assginments just ticked as layer 0 all works fine.

Any idea why this wouldn’t work?

Can you post a JSON file with your entire configuration?

hid-remapper-config (4).json (5.0 KB)

Thanks :slight_smile:

This works for me. When I hold a button wired to GPIO19, middle button sends W.

I had some ‘floating’ GPIO connections, i.e. uninitilised. I rectified that, thinking that might be the cause.

gpio_init(PIO_UNDEF_IN_pin_1);

gpio_set_dir(PIO_UNDEF_IN_pin_1, GPIO_IN);

gpio_pull_up(PIO_UNDEF_IN_pin_1);

gpio_init(PIO_UNDEF_IN_pin_2);

gpio_set_dir(PIO_UNDEF_IN_pin_2, GPIO_IN);

gpio_pull_up(PIO_UNDEF_IN_pin_2);

gpio_init(PIO_UNDEF_IN_pin_3);

gpio_set_dir(PIO_UNDEF_IN_pin_3, GPIO_IN);

gpio_pull_up(PIO_UNDEF_IN_pin_3);

gpio_init(PIO_UNDEF_IN_pin_4);

gpio_set_dir(PIO_UNDEF_IN_pin_4, GPIO_IN);

gpio_pull_up(PIO_UNDEF_IN_pin_4);

That didn’t fix it.

Then, I inverted the logic on the board that sets that GPIO.

Now it works.
I have no idea why that would matter…

The way GPIO inputs work is they have pull-ups enabled and pressing a button shorts them to GND if that’s what you mean.

I have a dual pico remapper on my trackball.

There’s a customised keyboard for FreeCAD (below)

which has one pico to read its keypresses, these are passed onto a second pico (rather like a dual pico remapper setup) The second pico converts the keys to USB MIDI data.

Within FreeCAD I have code which reads the incoming MIDI and does stuff! By using MIDI I get two way communication between FreeCAD and the keyboard, the keyboard (MIDI) Pico also connects to the HID Remapper that the trackball is on, again two way, limited to 6 GPIO connections.

Finally, we get to the point, I’m not using physical switches the switching is done by interconnected GPIO.

I still can’t see why reversing the logic of the output on the controlling Pico has fixed the problem I originally had, but it has!

Beats me.

I’ve just realised, you were talking about the GPIOs in HID-Remapper, the ones I was referring to are not HID-Remapper GPIOS, they’re on my keyboard processing MIDI output board.