Created
November 25, 2017 18:41
-
-
Save xyos/3bed0a7410514128e6964673805e59f0 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 rotate () { | |
int l_size = sizeof(leds)/sizeof(*leds); | |
int first_five = leds[0] >> 3; | |
int five_leds = 0; | |
for (int i = 1; i < l_size; ++i) { | |
five_leds = leds[i] >> 3; | |
leds[i-1] = ( ( leds[i-1] << 5 ) & 0b11100000 ) | five_leds; | |
cout << leds[i-1] << "\n"; | |
} | |
leds[l_size-1] = ( ( leds[l_size-1] << 5 ) & 0b11100000 ) | first_five; | |
cout << leds[l_size-1] << "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment