# Lesson 1.1.6 - LED Dot Matrix - spidev, rotation, and cleanup

**URL:** <https://forum.sunfounder.com/t/lesson-1-1-6-led-dot-matrix-spidev-rotation-and-cleanup/4912>\
**Category:** Learning kit for Raspberry Pi\
**Created:** [August 7, 2026, 9:27pm UTC](https://forum.sunfounder.com/t/lesson-1-1-6-led-dot-matrix-spidev-rotation-and-cleanup/4912 "2026-08-07T21:27:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ErinW](https://avatars.discourse-cdn.com/v4/letter/e/c89c15/32.png) [@ErinW](https://forum.sunfounder.com/u/ErinW)\
**Post date:** [August 7, 2026, 9:27pm UTC](https://forum.sunfounder.com/t/lesson-1-1-6-led-dot-matrix-spidev-rotation-and-cleanup/4912/1 "2026-08-07T21:27:52Z")

</div>

Two things on this lesson,

1. The fact that you need to install spidev in the \*\*virtual environment&& is a missing (or misordered?) step. I was super frustrated with this until I found the correction buried in a response to someone else’s question (from September 2025). It would be super helpful if this was updated in the Lesson instructions.
2. If you set up the matrix board and breadboard as shown in the Lesson, the rotation should be set to 3 (not 1 as it is in the code)
3. The def destroy(): code block just has ‘pass’ in it. That leaves a bunch of LEDs lit (whatever was lit when you do the Ctrl-C) which seems… wrong (not to mention distracting). Why have a destroy() block at all and just put “pass” under the except line? OR (better!) remove destroy() and use a code block like you did on 1.1.3 called ‘turn\_off\_all\_leds()’ - I did some research and device.clear() seems appropriate here. Yes?

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [August 12, 2026, 9:43am UTC](https://forum.sunfounder.com/t/lesson-1-1-6-led-dot-matrix-spidev-rotation-and-cleanup/4912/2 "2026-08-12T09:43:45Z")

</div>

Thank you for the detailed feedback! All three issues confirmed:

1. **Missing spidev install step** — Correct, `pip install spidev` is needed in venv. Workaround:

2. **Rotation should be 3** — Confirmed, the rotation value should be 3 per the wiring shown. Code will be fixed.

3. **destroy() cleanup** — `device.clear()` is the right approach. We will update destroy() to use device.clear() instead of pass.

Thanks Erin! These will be reflected in the next doc update.
