FideliusFalcon / rpi_pico_max7219

Raspberry Pico MAX7219 driver and wiring
31 stars 5 forks source link

Scroll delay = None doesn't work #4

Open Patriboom opened 2 years ago

Patriboom commented 2 years ago

Merci pour le travail accompli et rendu disponible.

Hello,

here is the modified code to test steady text:

... 
        self.MAX7219_SCROLL_DELAY = None
        cs_pin = 5

        spi = SPI(0)
        self.display = max7219.Matrix8x8(spi=spi, cs=Pin(cs_pin), num=self.MAX7219_NUM)
        self.display.brightness(2)

    def text_scroll(self, text, scroll_delay=None):
...

The result is: Traceback (most recent call last): File "<stdin>", line 30, in <module> File "<stdin>", line 26, in text_scroll TypeError: can't convert NoneType to float

I've tried with delay = 0 and it's just crasy fast I've tried with no defined delay : error message Traceback (most recent call last): File "<stdin>", line 30, in <module> File "<stdin>", line 26, in text_scroll AttributeError: 'matrix' object has no attribute 'MAX7219_SCROLL_DELAY'

Also tried the following command ( last line of main.py ) : led.text_scroll(text, None) It scrolls the exact same as led.text_scroll(text)

Patriboom commented 2 years ago

I fixed it and submit a pull request. Otherwise, you can follow my fork where the patch is available.