Skip to content

Go even faster by using hardware SPI #2

@simon3270

Description

@simon3270

Hi fangfuf. Nice code - certainly faster and neater than the original!

If you really want a boost, though, you need to use hardware SPI. Enable SPI in raspi-config ("sudo raspi-config", then enable SPI in the "Interface options" page), separate the tree from the Pi, then use breadboard wires (male-to-female) to connect the 4 wires you need:

  • Pin 2 on the tree to pins 2 or 4 on the Pi (5volts)
  • Pin 6 on the tree to pin6 6 on the Pi (Ground)
  • Pin 22 (GPIO25) on the tree to pin 23 (GPIO11) on the Pi (SPI Clock)
  • Pin 32 (GPIO12) on the tree to pin 19 (GPIO10) on the Pi (MOSI)

Update tree.py line 35 and remove the "mosi_pin=12, clock_pin=25" to leave just

super(FastRGBChristmasTree, self).__init__()

Now watch the LEDs fly!

Still not quite sure why they picked non-standard, and slow, pins for SPI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestwontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions