SSD1306_SPI TypeError: function expected at most 5 arguments, got 6



  • Hi,
    I'm having a WiPy 3.0 with Expansion Board 3.0 and an SSD1306_SPI module from adafruit. (https://www.adafruit.com/product/661)
    I've downloaded a driver from https://github.com/micropython/micropython/blob/master/drivers/display/ssd1306.py.

    I've imported the file into the library folder on my device.
    When I run the script in Atom I've got the following error:

    Traceback (most recent call last):
    File "<stdin>", line 7, in <module>
    TypeError: function expected at most 5 arguments, got 6

    MicroPython v1.8.6-621-g17ee404e on 2017-05-25; WiPy with ESP32

    script:

    import machine
    from machine import SPI, Pin as pin
    from ssd1306 import SSD1306_SPI as ssd
    spi = machine.SPI(0,SPI.MASTER, baudrate=2000000, polarity=0, phase=0)
    oled = ssd(128, 32, spi, pin('P5'), pin('P6'), pin('P7'))
    '''
    oled.fill(0)
    oled.show()
    oled.fill(1)
    oled.show()
    oled.fill(0)
    oled.show()
    oled.text("Hello World!", 0,0)
    oled.show()
    '''
    
    So what's wrong with the line:
    oled = ssd(128, 32, spi, pin('P5'), pin('P6'), pin('P7')) ?
    
    In the script itself I see:
    class SSD1306_SPI(SSD1306):
        def __init__(self, width, height, spi, dc, res, cs, external_vcc=False):
    

 

Hello World?

Pylife on Kickstarter - November 2018








Back Us On Kickstarter >

Pycom on Twitter