Skip to content

Instantly share code, notes, and snippets.

@TheSofox
Created November 6, 2020 00:10
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 TheSofox/0c18413a121efb2b10a5cc5eed42bbbc to your computer and use it in GitHub Desktop.
Save TheSofox/0c18413a121efb2b10a5cc5eed42bbbc to your computer and use it in GitHub Desktop.
void setPixel(int x, int y){
int board = 0;
int nx = x;
int ny = y;
if(nx<8 && ny<16){
nx = 7 - x;
board = 0;
}
if(ny>=16){
int yrem = y-16;
nx = 7 - (3-yrem);
ny = x+1;
board = 1;
}
if(x==8 && y<=3){
nx = 2;
ny = y+11;
board = 1;
}
if(x==9 && y<=3){
nx = 3;
ny = y+11;
board = 1;
}
if(x==8 && y>3 && y<8){
nx = 1;
ny = 14 - (y-4);
board = 1;
}
if(x==9 && y>3 && y<8){
nx = 0;
ny = 14 - (y-4);
board = 1;
}
if(x==8 && y>=8 && y<12){
nx = 6;
ny = y + 3;
board = 1;
}
if(x==9 && y>=8 && y<12){
nx = 7;
ny = y + 3;
board = 1;
}
if(x==8 && y>=12 && y<16){
nx = 4;
ny = 14 - (y-12);
board = 1;
}
if(x==9 && y>=12 && y<16){
nx = 5;
ny = 14 - (y-12);
board = 1;
}
/*Serial.print(nx);
Serial.print(" " );
Serial.println(ny);*/
if(board==0){
matrix.drawPixel(nx, ny, LED_ON);
}
if(board==1){
matrix2.drawPixel(nx, ny, LED_ON);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment