Replies: 2 comments 4 replies
-
Update: I tried using |
Beta Was this translation helpful? Give feedback.
-
I used a program also more or less that example.
private SpiConfig buildSpiConfig(Context pi4j, int channel, int frequency) {
return Spi.newConfigBuilder(pi4j)
.id("SPI" + 1)
.name("LED Matrix")
.bus(SpiBus.BUS_1)
.address(channel)
.mode(SpiMode.MODE_0)
.baud(8 * DEFAULT_FREQUENCY_PI4) // bit-banging from Bit to SPI-Byte
.provider("pigpio-spi")
.build();
} Changing this to bus 0 or 1, the spi traffic moves as expected and the neopixel illuminates. I am using a Pi4 and have no access to any Pi Zeros. As with you, sometimes the neopixel has the correct colors, other times just all white. I am not going to attach a scope and chase what frequency the is usually using. I have old notes on setting the Pi HW to maintain a more steady FREQ and reliable operation. So as I said I have no Pi Zero to use with the scope and verify how it operates. Sorry |
Beta Was this translation helpful? Give feedback.
-
When using SPI, I can't figure out how I can make it use SPI1. I have two SPI devices, an OLED display that actually uses SPI, and a LED strip using the code that's listed in the examples. I tried putting in channel 1 in the constructor for the LED strip, as well as the OLED screen (separately) but it ended up outputting both over SPI1, causing major issues. I'm using a Pi Zero 2 W, and pi4j 2.6.0 (so it's not the pre-2.6 issues with multiple SPIs, it seems to open both just fine and the program runs without errors, but it's going over the same SPI)
Beta Was this translation helpful? Give feedback.
All reactions