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

botton bank #38

Closed
zley1 opened this issue Sep 30, 2019 · 7 comments
Closed

botton bank #38

zley1 opened this issue Sep 30, 2019 · 7 comments

Comments

@zley1
Copy link

zley1 commented Sep 30, 2019

hi, i am having trouble on a code for a 6 banks of buttonmatrix with 6 leds and two butons for changing banks
buttom matrix is 6 buttons (two rows 3 colums)
i want to be able to choose the note for each button in every bank. i try some of the examples but i get errors with them.
thanks in advance

tttapa added a commit that referenced this issue Sep 30, 2019
@tttapa
Copy link
Owner

tttapa commented Sep 30, 2019

I added an example, but I haven't tested it yet.

@zley1
Copy link
Author

zley1 commented Sep 30, 2019

thnx!! but how do i choose the notes for each bank? i want to have different scales for playing melodies.

@tttapa
Copy link
Owner

tttapa commented Oct 1, 2019

That's currently not supported. But I'm in the process of adding the code for it.

@zley1
Copy link
Author

zley1 commented Oct 2, 2019 via email

@tttapa
Copy link
Owner

tttapa commented Oct 25, 2019

I added ManyAddresses::NoteButtonMatrix, but I don't have time at the moment to add the LEDs.

@panakronic
Copy link

panakronic commented Dec 16, 2019

Hi

I have 4 banks with two butons for changing banks. Please see example MIDI_controller-97.

My question: Is is possible to use RGB LED strip with 4 pre-defined colors instead of 4 seperate LED of different color? I am currently using a 5mm 4-pin RGB LED bulb and it allows me only 3 color changes - Red, Green and Blue. How can I add one or more colors?

@tttapa
Copy link
Owner

tttapa commented Dec 16, 2019

The LED outputs for the Selectors are defined here:

template <setting_t N>
class SelectorLEDsCallback {
public:
SelectorLEDsCallback(const PinList<N> &ledPins) : ledPins{ledPins} {}
/// Initialize.
void begin() {
for (pin_t pin : ledPins) {
AH::ExtIO::pinMode(pin, OUTPUT);
AH::ExtIO::digitalWrite(pin, LOW);
}
}
/// Refresh, called periodically.
void update() {}
/// Called when the setting changes.
void update(setting_t oldSetting, setting_t newSetting) {
AH::ExtIO::digitalWrite(ledPins[oldSetting], LOW);
AH::ExtIO::digitalWrite(ledPins[newSetting], HIGH);
}
private:
PinList<N> ledPins;
};

You can easily write your own callback to drive the LEDs the way you want. Then you just pass your callback class to the Generic***Selector template classes, as shown in further down in the file mentioned earlier.

@tttapa tttapa closed this as completed Feb 10, 2021
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