bitluni / PingPongLEDMatrix

36 stars 12 forks source link

Awesome Lighteffect not working on other matrix size :( #1

Closed veitk closed 4 years ago

veitk commented 4 years ago

Hi bitluni,

i love this project! I build a 17*8 matrix and it works very good, but your lighteffect has some "magic numbers" and i don't figure out how to get it right ....

i have a zigzag setup (the text works perfect) and tried it like this: for(int y = 0; y < 8; y++) for(int x = 0; x < 17; x++)

  if(y & 1)
   matrix.setPixelColor(16 - x + y * 17, matrix.gamma32(matrix.ColorHSV((x + y) * 256 * 8 + i * 128 * 2)));
  else
    matrix.setPixelColor(x + y * 17, matrix.gamma32(matrix.ColorHSV((x + y) * 256 * 8+ i * 128 * 2)));

can you point me to the right direction?

viele grüße aus münchen veit

veitk commented 4 years ago

so i slept a night over it and i activated my brain ... you connected your led's in rows, i connected mine in columns. so i had to switch the values in the for loop. for(int y = 0; y < 17; y++){ for(int x = 0; x < 8; x++){

  if(y & 1){
    matrix.setPixelColor(7 - x + y * 8, matrix.gamma32(matrix.ColorHSV((x + y) * 256 * 8 + i * 128 * 2)));
  }
  else{
    matrix.setPixelColor(x + y * 8, matrix.gamma32(matrix.ColorHSV((x + y) * 256 * 8 + i * 128 * 2)));
  }
}

}

works awesome now, but unfortunately now i have a dead (or wrong) pixel which on my small board is easier to see than on your big one, if you detect the dead pixel once you can't look away :-P