w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to mirror an array with WS2801 LEDs?

You need to reset cols to 0 at the start of each iteration of your rows for() loop.

for(rows = 0; rows < ROWS; rows++)  {
   readEQ();
  // should light up a whole row at once starting from the beginning of the
array
  cols = 0; //reset cols to zero to iterate next set of columns
  while (cols != COLS) {  //while in row # x fill all the col values until
= COL value

Incidentally, it's not clear if you should call readEQ every row, or only after you have finished an entire display grid - each will have various advantages (rate of partial response, vs self-consistency of updates)





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.