change the ManyButtonsSelector #495
Replies: 5 comments 3 replies
-
You could try something like this (untested): template <setting_t N, class Callback = EmptySelectorCallback>
class GenericCustomManyButtonsSelector : public GenericSelector<N, Callback> {
using Parent = GenericSelector<N, Callback>;
public:
GenericCustomManyButtonsSelector(Selectable<N> &selectable,
const Callback &callback,
const Array<AH::Button, N> &buttons)
: Parent{selectable, callback}, buttons(buttons) {}
void begin() override {
Parent::begin();
for (AH::Button &b : buttons)
b.begin();
}
void update() override {
Parent::update();
for (setting_t i = 0; i < N; i++)
if (buttons[i].update() == AH::Button::Falling)
this->set(i);
}
private:
Array<AH::Button, N> buttons;
}; |
Beta Was this translation helpful? Give feedback.
-
I got an error in my sketch after changing the selector:
My code:
|
Beta Was this translation helpful? Give feedback.
-
Yes, I changed the code in the library files. But I returned everything to its original state. Not sure where in the sketch should I insert your code? Tried it in different places, but your code did not change anything in the operation of the device. |
Beta Was this translation helpful? Give feedback.
-
thank you, I will wait very much |
Beta Was this translation helpful? Give feedback.
-
Everything works, thanks, Pieter. I am sharing my sketch. Made it for FootSwitch using amplitube 5.
|
Beta Was this translation helpful? Give feedback.
-
Hi, how do I change the ManyButtonsSelector.hpp so that the ManyButtonsSelectorLeds are sent every click by the PC? Default settings the selector ignores repeated pressing of the button too.
Beta Was this translation helpful? Give feedback.
All reactions