Momentary switch on Versio not working

Hi there, first post here…
I’ve just started dabbling with writing firmwares for the Versio using libdaisy and run into an issue:

I can’t seem to detect any presses on the momentary switch (Tap/FSU/Hit etc.) of my versio unit.

hw.SwitchPressed() 

doesn’t catch anything and stays ‘false’ all the time. The corresponding CV input (Gate) is working fine, though. I can also get the button to work using oopsy and gen~, so it’s not a hardware issue.

Here’s some code for testing:

#include "daisy_versio.h"

using namespace daisy;

DaisyVersio hw;         

int main(void)
{
    hw.Init();
    hw.seed.StartLog(true);    

    while(1) {
        // this doesn't work...
		 if (hw.SwitchPressed() )
		 	hw.seed.PrintLine("pressed!");
		 else 
		 	hw.seed.PrintLine("not pressed!");

         // this works fine
		 if (hw.Gate() )
		 	hw.seed.PrintLine("Gate HIGH!");

        System::Delay(100);
    }
}

Any ideas what’s going wrong here? Thanks!

Hi,
I think you have to debounce the tap button.

while(1) {
   tap.Debounce();
  ...
}

Best regards

1 Like

thanks @maasijam , that was spot on. It’s working fine now!

I would have expected the SwitchPressed() function to do the debouncing for me in the background, but ok, it’s easy enough to put that line in myself.
Thanks again.

2 Likes