fangfufu / FastRGBChristmasTree

A faster version of The Pi Hut RGB Christmas Tree driver.
GNU General Public License v3.0
6 stars 1 forks source link

Go even faster by using hardware SPI #2

Open simon3270 opened 3 years ago

simon3270 commented 3 years ago

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:

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.

fangfufu commented 3 years ago

Oh wow, thanks! I suppose one can just mod the board itself.

But yes, I certainly feel their design did not go through proper review process, much like their driver code - there definitely was no code review.