Last active
May 7, 2019 21:55
-
-
Save J3698/ff73c5da9a8aa8ff3dc7a54066caf4c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void update_lights(bool beat_detected) { | |
static uint8_t blueness = 0; | |
if (beat_detected) { | |
blueness = MAX_BRIGHTNESS; | |
} else if (blueness >= BRIGHTNESS_DECAY) { | |
blueness = blueness - BRIGHTNESS_DECAY; | |
} else { | |
blueness = 0; | |
} | |
APA102_Fill(led_strip, APA102_CreateFrame(STRIP_BRIGHTNESS, 0, 0, blueness)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment