I have a project that I originally created with Arduino and now want to move it to MicroPython on an ESP32 board. I've looked through a few of the MAX7219 when using the chip for 7-segment LEDs. I'm finding an inconsistency in how these various libraries are implementing the SPI call in the constructor, where each use different arguements to SPI(). I'm just not sure how to specify the DIN, CLK and LOAD pins, and am getting inconsistent (or non-existent) results on the LEDs. I may not be able to rely on the default SPI, CLK and LOAD pins on the ESP32 because I will eventually have more than one SPI device (e.g. and SD card) on this board. For those who have not worked with the MAX7219, there are three pins connected to the board: DIN, CLK and LOAD. If you're cascading multiple chips, there's a data out that connects to the next DIN. The CLK and LOAD are shared connections.
For example, one has this:
Code: Select all
self._spi = SPI(SPI_BUS, baudrate=baudrate, polarity=0, phase=0)
Code: Select all
self.spi = SPI(1, baudrate=10000000, polarity=1, phase=0, sck=clk, mosi=din)
Code: Select all
hspi = SPI(1, 10000000, sck=Pin(14), mosi=Pin(13), miso=Pin(12))
vspi = SPI(2, baudrate=80000000, polarity=0, phase=0, bits=8, firstbit=0, sck=Pin(18), mosi=Pin(23), miso=Pin(19))