-
Notifications
You must be signed in to change notification settings - Fork 38
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
Hardware schematic to stack Rpi Hats #30
Comments
I was curious about the same thing, and it turns out that you can see the traces on the board itself if you look closely. Here's what I see for the GPIO pinout:
Those SPI pins are also referenced in tree.py's constructor for RGBXmasTree: Lines 38 to 40 in 24fe82e
Notably, I don't see a reference to a chip select pin for RGBXmasTree, so I'm not sure if it'll play nicely with other devices on the same bus. You may need to experiment further on that front, or else find a way for your other devices to use a different SPI bus. |
Yeah, I had initially mistakenly assumed that the LEDS were controlled by different Rpi IO pins. Seems like the RGB LEDs have an embedded SPI chip and only use (Data, Clock, Power, Gnd). I remembered I had used a version of these before called Neopixel LEDs. Somehow they are still individually addressable but they don't use the full SPI implementation since they don't use the “select” or “miso” pin of SPI. Looking at the GPIOZero library called in the initiation it said if pins are not defined they declare the default pin assignments. For MISO, SELECT this would conflict with the other piFace hat I wanted to stack that does have hardwired and make use of the “select” pin 8 I replaced two lines of code on tree.py to declare MISO and SELECT to pins 23 and 24 even though it's not used by rgbxmastree just so it does not interfere with the other hat. So they are assigned but floating since not connected to anything. After some trial and error I got the rgbxmastree and the piFace hat working . Reading GPIOZero documentation it seems that it can only run software or hardware implementation of SPI but not both at the same time. For my application it's not a big limitation. I'm running randomsparkles.py. and the other hat piFace drives another decoration with a chime that plays for 1 min every hour. While it's playing the rgbxmastree stops sparkling. After chime ends then rgbxmastree resumes sparkling. The only thing I had to do on the piFace code was to make sure to de-initialize the SPI instance at the end of script so that when it ends randomandomsparkles.py continues. |
More of a request: Is there a hardware schematic documented to what pins are being used and what LED location to what pin?. To determine if can stack another shield/hat. I wanted to see if i could stack another Pi hat "PiFace-Digital2" that has two relays. That hat uses hardware SPI and wanted to use one of the Relays to control another xmas decoration while using the RGB xmas tree.
The text was updated successfully, but these errors were encountered: