Firstly, thats for writing this config. I couldnt have done this without it. This is more of a suggestion and tell me if ive done this wrong "issue" rather than anything wrong with your config
I have noticed that the touch events for a single button are fired before a swipe event causing confusion on use. E.g if i swipe from left to right, the button press animation starts, then the swipe starts.
I have played around with you config and have managed to move the animations from on_press into on_release.
Effectively, on_press does nothing, and actions for led_on_touch is moved into handle_release. This might not be an issue with the default rainbow config, but I have a custom swipe left/right animation and split a led action between the 3 buttons and they were overlapping.
This basically, has the leds above the buttons turn on, but only if a press is detected. A swipe will run the swipe animation instead of running the touch events
Changes made
Remove on_press action
Add swipe animation to leds_top:
(havnt figured out how to take the variable colors into this lambda)
- addressable_lambda:
name: "Scan Right"
update_interval: 50ms
lambda: |-
static uint16_t progress = 0;
static Color normal = Color(255, 65, 206);
if (initial_run) {
progress = 0;
it.all() = Color::BLACK;
}
else {
//progress 1 led
if (progress < it.size()) {
it[progress] = normal;
progress++;
}
//When reach the end stop
else {
}
};
- addressable_lambda:
name: "Scan LEFT"
update_interval: 50ms
lambda: |-
static uint16_t progress = 0;
static Color normal = Color(255, 65, 206);
if (initial_run) {
progress = 0;
it.all() = Color::BLACK;
}
else {
//progress 1 led
if (progress < it.size()) {
it[it.size() - progress] = normal;
progress++;
}
//When reach the end stop
else {
}
};
Added more led partitions for individual top buttons:
Firstly, thats for writing this config. I couldnt have done this without it. This is more of a suggestion and tell me if ive done this wrong "issue" rather than anything wrong with your config
I have noticed that the touch events for a single button are fired before a swipe event causing confusion on use. E.g if i swipe from left to right, the button press animation starts, then the swipe starts.
I have played around with you config and have managed to move the animations from
on_press
intoon_release
.Effectively, on_press does nothing, and actions for
led_on_touch
is moved intohandle_release
. This might not be an issue with the default rainbow config, but I have a custom swipe left/right animation and split a led action between the 3 buttons and they were overlapping.This basically, has the leds above the buttons turn on, but only if a press is detected. A swipe will run the swipe animation instead of running the touch events
Changes made
Remove
on_press
actionAdd swipe animation to
leds_top
: (havnt figured out how to take the variable colors into this lambda)Added more led partitions for individual top buttons:
add to the top of
handle_release
"then" section:New button scripts: