goyousalukis Posted January 1, 2006 Report Posted January 1, 2006 Hello everyone and happy new year!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.ThanksJustin Quote
TK. Posted January 1, 2006 Report Posted January 1, 2006 Hi Justin,welcome back! :)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 beforeBest Regards, Thorsten. Quote
goyousalukis Posted January 2, 2006 Author Report Posted January 2, 2006 Hey TK,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?.Sorry if my ASM is ugly - it's been a long time....Thanks Justin Quote
TK. Posted January 3, 2006 Report Posted January 3, 2006 Hi Justin,do I need to put the button number back in it after the compare?some applications require this (not sure if this is the case for MB64), so just add a "movf MIOS_PARAMETER1, W" before branching to the handler.Sorry if my ASM is ugly - it's been a long time....it looks very compact :)Best Regards, Thorsten. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.