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

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?

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

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

    source venv/bin/activate
    pip install spidev
    

    We will update the lesson documentation.

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

  3. destroy() cleanupdevice.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.