peterhinch / micropython-samples

Assorted code ideas, unofficial MP FAQ, plus index to my other repositories.
MIT License
442 stars 91 forks source link

Connect with SPI, TypeError: function expected at most 5 arguments, got 6 #4

Closed dukeduck1984 closed 6 years ago

dukeduck1984 commented 6 years ago

Hi Peter,

I copied and pasted the files (freesans20.py, ssd1306.py, writer.py and ssd1306_test.py) per your instruction, and connected the pins per the comments (using SPI) in ssd1306_test.py, and run test(True), but I got:

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

I tried to track it according to the line number, appearantly it came from: ssd = SSD1306_SPI(WIDTH, HEIGHT, spi, pdc, prst, pcs), so I checked class SSD1306_SPI(SSD1306) in ssd1306.py but couldn't understand why it gave an error - everything looked right.

I was using a PYB Nano.

Thanks for the help in advance. Kaiyuan

peterhinch commented 6 years ago

I suspect that you're running an old version of firmware: there was a change around the new year which affected the SSD1306 driver. A prior version will produce these apparently inexplicable errors. Please upgrade your firmware to the current build and try again.

dukeduck1984 commented 6 years ago

Hi Peter,

Thank you. You were correct. It worked after the upgrade.

Thanks for the help. Kaiyuan