user22887: https://www.arduino.cc/en/Tutorial/RowColumnScanning
This code really confused me because I don't know if the pixels[x][y] is HIGH or LOW in void refreshScreen().
As you look at the code, pixels[x][y] is HIGH and then LOW in void setup(), and then pixels[x][y] is HIGH again in void loop(). Could anyone explain this to me, please？

user20245: The pixels array in initialized to all HIGH in setup(). Then one element of the pixel array is set to LOW in readSensors()  which turns on one LED.
The tricky bit is you have to remember to turn off the previous LED. That is why in readSensors() there is the line where an element of pixels is set HIGH while the pixels' array pointers are still pointing at the former (already lit) LED.

22887: <p><a href="https://www.arduino.cc/en/Tutorial/RowColumnScanning" rel="nofollow noreferrer">https://www.arduino.cc/en/Tutorial/RowColumnScanning</a></p>
<p>This code really confused me because I don't know if the <code>pixels[x][y]</code> is HIGH or LOW in <code>void refreshScreen()</code>.</p>
<p>As you look at the code, <code>pixels[x][y]</code> is HIGH and then LOW in <code>void setup()</code>, and then <code>pixels[x][y]</code> is HIGH again in <code>void loop()</code>. Could anyone explain this to me, please？</p>
 20245: <p>The pixels array in initialized to all HIGH in <code>setup()</code>. Then one element of the pixel array is set to LOW in <code>readSensors()</code>  which turns on one LED.</p>
<p>The tricky bit is you have to remember to turn off the previous LED. That is why in <code>readSensors()</code> there is the line where an element of pixels is set HIGH while the pixels' array pointers are still pointing at the former (already lit) LED.</p>
