-
-
Save darcymistry/1c7487c6a683e6bd26c360785e41fdd4 to your computer and use it in GitHub Desktop.
help code
This file contains 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
bpm = 50; | |
uint8_t halfBeat = beat8(bpm/2), beat = beat8(bpm); | |
// Position of the strip to light up a pixel | |
segFHPos = lerp8by8( 0, lenFH - 1, beat); | |
segDBPos = lerp8by8( 0, lenDB - 1, beat); | |
segAPos = lerp8by8( 0, lenA - 1, beat); | |
segCPos = lerp8by8( 0, lenC - 1, beat); | |
segEPos = lerp8by8( 0, lenE - 1, beat); | |
segGPos = lerp8by8( 0, lenG - 1, beat); | |
// Call the function that lights up the strip at the given position | |
if (halfBeat < 128) { | |
segA.colorPixel(segAPos); | |
segC.colorPixel(segCPos); | |
segE.colorPixel(segEPos); | |
segG.colorPixel(segGPos); | |
} else { | |
segFH.colorPixel(segFHPos); | |
segDB.colorPixel(segDBPos); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment