Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Momentary as Toggle #104

Open
fristaildg opened this issue Jan 30, 2020 · 2 comments
Open

Use Momentary as Toggle #104

fristaildg opened this issue Jan 30, 2020 · 2 comments

Comments

@fristaildg
Copy link

Hi! I'm super new at this and I'm sure this is a very simple task to achieve.
I need to send CC messages to control Bias FX pedals and have done this so far:
`#include <Control_Surface.h>

HairlessMIDI_Interface midi;

CCButton buttons[] = {
{2, {MIDI_CC::Foot_Controller, CHANNEL_1}}
};

void setup() {
// put your setup code here, to run once:
Control_Surface.begin();
}

void loop() {
// put your main code here, to run repeatedly:
Control_Surface.loop();
}`

But every time I press the button it sends on (127) when I press and off (0) when I release the button. How can I change my code to make the button behave as a toggler?

Huge thanks in advance!!

@tttapa
Copy link
Owner

tttapa commented Jan 30, 2020

You can use CCButtonLatched.
Have a look at the MIDI Output Elements module for a complete overview.

@luisFernandezDevSpark
Copy link

Yes I found it right after I asked you the question and it worked flawlessly.
Huge thanks for this library, it has made the life of a complete noob like me super easy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants