I haven’t posted for over a year, but I’m back on the midibox train. I have built a midibox 64 that I will use to trigger samples using foot pedals. I want to use cheap piano pedals that I already have. That being said, they are normally closed switches. I have already cracked one open and modified it to normally open, but I was wondering if there is an easy way to switch the button behaviour in MIOS for some of the buttons? If I have to, I’ll modify them, but I’d rather leave them alone.
You only need to invert the button value at the beginning of the USER_DIN_NotifyToggle hook, this could be done with “comf MIOS_PARAMETER2, F” - if only a certain number of buttons should be inverted, you need to check the button number in MIOS_PARAMETER1 before
Thanks for your quick reply. I did as you suggested and I think it works properly - I just wondered if you’d check my work in case I messed up in the ASM!
This is my USER_DIN_NotifyToggle
movlw 0x12 ;; load 18 into the WREG
cpfsgt MIOS_PARAMETER1 ;; Compare the button num to 18 skip if it is > 18
goto MB64_BUTTON_Handler ;; if less than don't complement
comf MIOS_PARAMETER2, F ;; if greater than complement
goto MB64_BUTTON_Handler ;;
I want to invert all the buttons greater than 18.
I was worried about the WREG - do I need to put the button number back in it after the compare?.