Open exo-cortex opened 1 year ago
@exo-cortex Have you found any solution of the issue? I also tried this crate and cannot figure out how to work with it. clear_display()
does not work correctly for me, clears the last column only. I only managed to use write_raw()
.
By the way, when I tried from_spi()
like you did, it does not work at all for me.
So I'm using from_spi_cs
let spi_sclk: gpio::Pin<_, gpio::FunctionSpi, gpio::PullNone> = pins.gpio2.reconfigure();
let spi_mosi: gpio::Pin<_, gpio::FunctionSpi, gpio::PullNone> = pins.gpio3.reconfigure();
let spi_miso: gpio::Pin<_, gpio::FunctionSpi, gpio::PullUp> = pins.gpio4.reconfigure();
let spi_cs = pins.gpio5.into_push_pull_output();
// Create the SPI driver instance for the SPI0 device
let spi = spi::Spi::<_, _, _, 8>::new(pac.SPI0, (spi_mosi, spi_miso, spi_sclk));
// Exchange the uninitialised SPI driver for an initialised one
let spi = spi.init(
&mut pac.RESETS,
clocks.peripheral_clock.freq(),
1.MHz(),
embedded_hal::spi::MODE_0,
);
let mut display = MAX7219::from_spi_cs(1, spi, spi_cs).unwrap();
Not yet unfortunately. I on-and-off tried to work around the problem. I think I found other code to address the max7219 somewhere that I used. But it's not a very nice solution. I'd rather use this library. Will try again!
Hi, I was trying to use this crate with a raspberry pi pico. I used it like that:
If I then write data to it via
write_rat()
I sometimes get weird errors and suddenly all the pixels turn on, or the intensity is higher (even though). In the MAX7219's Datasheet I can find that it expects 16bits over SPI. But with MAX7219 I can only use 8 as DS-parameter (see the8
inlet spi = bsp::hal::Spi::<_,_,8>::new(pac.SPI1);
). Is there an error here?Could it be that in the spi-implementation there is only the
Write<u8>
-traits used and not aWrite<u16>
?I found another example where someone put text on this display and it used DS=16,but implemented the MAX7219-thing from scratch. See here.
I am still a noob in embedded rust, so sorry if that is wrong and I am wasting somebodies time.
That is all. Thank you :-)