Skip to content

Instantly share code, notes, and snippets.

@hpwit
Created January 18, 2020 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hpwit/5085512f3bff94be7bf9e543567cc6db to your computer and use it in GitHub Desktop.
Save hpwit/5085512f3bff94be7bf9e543567cc6db to your computer and use it in GitHub Desktop.
Turn and cry
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