Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go even faster by using hardware SPI #2

Open
simon3270 opened this issue May 11, 2021 · 1 comment
Open

Go even faster by using hardware SPI #2

simon3270 opened this issue May 11, 2021 · 1 comment
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@simon3270
Copy link

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.

@fangfufu
Copy link
Owner

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.

@fangfufu fangfufu added the enhancement New feature or request label May 11, 2021
@fangfufu fangfufu pinned this issue May 11, 2021
@fangfufu fangfufu added the wontfix This will not be worked on label May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants