user57005: I was following the official tutorial of LED matrix integration and couldn't figure out why there is no resistor.
I assumed there are built-in resistors in the LED matrix, so I did an experiment by connecting pin 9 of the LED matrix to v5 of my Arduino Leonardo board and pin 13 of the LED matrix to GND of the same board. You can refer to the schematic diagram below to know I was trying to lit up the LED at the position [0, 0].
Unfortunately, the LED next to [0, 0] burned immediately and I still couldn't figured out it.

Question

Are resistors necessary for 8x8 LED matrix?

If yes, why the official example doesn't have any resistor?
If no, why my experiment failed?
If no, why are there so many unofficial examples use resistors for each wire?



Source
https://docs.arduino.cc/built-in-examples/display/RowColumnScanning
Circuit

Schematic


user38721: Well done Arduino, you did a great job providing a magic-smoke tutorial [sarkasm off]. IDK how this tutorial could make it into their official docs, it should not be there!
You definitely need series resistors at each column or at each row to protect the LEDs/GPIOs (that's 8 resistors). There may be matrices that integrate resistors, but your one and the one they use in their docs does not.
An alternative is to configure the column GPIOs as inputs with enabled pullups and the row GPIOs as ordinary outputs. This way, current will be limited by the pullup resistors. But as those are quite large (several 10kOhm depending on MCU) the LEDs will be very dim.

57005: <p>I was following <a href="https://docs.arduino.cc/built-in-examples/display/RowColumnScanning" rel="nofollow noreferrer">the official tutorial of LED matrix integration</a> and couldn't figure out why there is no resistor.</p>
<p>I assumed there are built-in resistors in the LED matrix, so I did an experiment by connecting pin 9 of the LED matrix to v5 of my Arduino Leonardo board and pin 13 of the LED matrix to GND of the same board. You can refer to the schematic diagram below to know I was trying to lit up the LED at the position [0, 0].</p>
<p>Unfortunately, the LED next to [0, 0] burned immediately and I still couldn't figured out it.</p>
<p><img src="https://i.stack.imgur.com/haoD5.jpg" alt="" /></p>
<h1>Question</h1>
<ol>
<li>Are resistors necessary for 8x8 LED matrix?
<ol>
<li>If yes, why the official example doesn't have any resistor?</li>
<li>If no, why my experiment failed?</li>
<li>If no, why are there so many unofficial examples use resistors for each wire?</li>
</ol>
</li>
</ol>
<h1>Source</h1>
<p><a href="https://docs.arduino.cc/built-in-examples/display/RowColumnScanning" rel="nofollow noreferrer">https://docs.arduino.cc/built-in-examples/display/RowColumnScanning</a></p>
<h1>Circuit</h1>
<p><img src="https://i.stack.imgur.com/PEvsg.png" alt="" /></p>
<h1>Schematic</h1>
<p><img src="https://i.stack.imgur.com/jFRqg.png" alt="" /></p>
 38721: <p>Well done Arduino, you did a great job providing a magic-smoke tutorial [sarkasm off]. IDK how this tutorial could make it into their official docs, it should not be there!</p>
<p>You definitely need series resistors at each column or at each row to protect the LEDs/GPIOs (that's 8 resistors). There may be matrices that integrate resistors, but your one and the one they use in their docs does not.</p>
<p>An alternative is to configure the column GPIOs as inputs with enabled pullups and the row GPIOs as ordinary outputs. This way, current will be limited by the pullup resistors. But as those are quite large (several 10kOhm depending on MCU) the LEDs will be very dim.</p>
