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

Indexable strip specific code #1

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Small refactor of animations for v0.01
  • Loading branch information
BaptisteHudyma committed Oct 23, 2024
commit c6c347fd33220cf7f2fd38b86f3f98e78a1f7e5c
34 changes: 17 additions & 17 deletions src/user_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,9 @@ void calm_mode_update() {
GenerateRainbowSwirl(5000); // swirl animation (5 seconds)
if (categoryChange) rainbowSwirl.reset();

// animations::fill(rainbowSwirl, strip);
animations::fill(rainbowSwirl, strip);

imu::gravity_fluid(128, rainbowSwirl, strip, categoryChange);

rainbowSwirl.update(); // update
rainbowSwirl.update();
break;
}
case 1: // party wheel
Expand Down Expand Up @@ -217,7 +215,6 @@ void calm_mode_update() {
}
case 6: {
animations::fire(60, 60, 255, PaletteHeatColors, strip);
// animations::mode_lake(128, PaletteOceanColors, strip);
break;
}
case 7: {
Expand Down Expand Up @@ -306,13 +303,13 @@ void sound_mode_update() {
microphone::vu_meter(redToGreenGradient, 128, strip);
break;

case 1: // pulse soud
microphone::fftDisplay(128, 128, PaletteHeatColors, categoryChange, strip,
255);
/*case 1: // pulse soud
microphone::fftDisplay(128, 128, PaletteHeatColors, categoryChange,
strip, 255);

break;
break;*/

case 2:
case 1:
microphone::mode_2DWaverly(128, 64, PalettePartyColors, strip);
break;

Expand All @@ -326,7 +323,7 @@ void sound_mode_update() {
categoryChange = false;
}

void gyro_mode_update() {
void sirenes_mode_update() {
constexpr uint8_t maxGyroState = 0;
switch (clamp_state_values(colorState, maxGyroState)) {
case 0:
Expand All @@ -346,25 +343,28 @@ void gyro_mode_update() {
void color_mode_update() {
constexpr uint8_t maxColorMode = 4;
switch (clamp_state_values(colorMode, maxColorMode)) {
case 0: // gradient mode
case 0: // Fixed colors, that the user can change
gradient_mode_update();
break;

case 1: // calm mode
case 1: // slow changing animations, nice to look at
calm_mode_update();
break;

case 2:
// fast pacing animations
party_mode_update();
break;

case 3: // sound mode
case 3: // sound reacting mode
sound_mode_update();
break;

case 4: // gyrophare
gyro_mode_update();
break;
/*
case 4: // diverse alerts (police, firefighters etc)
sirenes_mode_update();
break;
*/

default:
colorMode = 0;
Expand Down