You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
Firstly I want to tell you that your work is fantastic and helps me a lot in my projects!
I would like to assign momentary switches to LEDs, my switches are multiplexed (4067) and my LEDs work via TLC5940.
The idea is that when I press a switch the corresponding LED lights up and when I press it it turns off.
I got there for an LED, however for many I am struggling to find a suitable formula.
For several leds I have tried:
if (button [0,1,2] .getButtonState () == Button :: Rising)
or
if (button []. getButtonState () == Button :: Rising)
not working ...
Cordially
//code for one led
#include<Control_Surface.h>
#include<Tlc5940.h>
USBMIDI_Interface midi;
CD74HC4067 mux = {
A20,
{24, 25, 26, 1},
};
CCButtonLatched button[] = {
{ mux.pin(3), {53, CHANNEL_1}},
{ mux.pin(4), {54, CHANNEL_1}},
{ mux.pin(5), {55, CHANNEL_1}},
};
boolean x = 0 ;
voidsetup() {
Control_Surface.begin();
Tlc.init();
Tlc.clear();
}
voidloop() {
Control_Surface.loop();
Tlc.update();
if (button[1].getButtonState() == Button::Rising)
{ x = 1 - x ;
}
if (x>0)
{ Tlc.set (39, 4095);
}
elseif (x<1)
{ Tlc.set (39, 0);
}
delay(75);
}
The text was updated successfully, but these errors were encountered:
Hello,
Firstly I want to tell you that your work is fantastic and helps me a lot in my projects!
I would like to assign momentary switches to LEDs, my switches are multiplexed (4067) and my LEDs work via TLC5940.
The idea is that when I press a switch the corresponding LED lights up and when I press it it turns off.
I got there for an LED, however for many I am struggling to find a suitable formula.
For several leds I have tried:
if (button [0,1,2] .getButtonState () == Button :: Rising)
or
if (button []. getButtonState () == Button :: Rising)
not working ...
Cordially
The text was updated successfully, but these errors were encountered: