Created
January 18, 2020 16:18
-
-
Save hpwit/0a727be6e6675793cb3fa0f2573da2ed to your computer and use it in GitHub Desktop.
Turn and cry
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
CRGB img[]; | |
CRGB leds[]; | |
//we want to display at x0,y0 and imaage of size width,height on a LED_WIDTH, LED_HEIGHT panel (turned 90) | |
//read the image from SD | |
myFile.read((uint8_t *)img,NUM_LEDS*sizeof(CRGB)); | |
//copy with turn 90 | |
int x0=0; | |
int y0=0; | |
for (int x=0;x<width;i++) | |
{ | |
for (int y=0;y<height;j++) | |
{ | |
if(x0+x<LED_HEIGHT && y+y0w<LED_WIDTH) | |
{ | |
img[x+y*width]=leds[(x0+x)*LED_WIDTH+(y+y0)]; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment