SSD1306 library for the micro:bit

Questions and discussion about running MicroPython on a micro:bit board.
Target audience: MicroPython users with a micro:bit.
Post Reply
fizban
Posts: 24
Joined: Mon Oct 24, 2016 2:32 pm

SSD1306 library for the micro:bit

Post by fizban » Thu Feb 23, 2017 11:22 pm

I have created a small library to control an SSD1306 OLED display from a micro:bit. Currently it only supports I2C and has very limited functionality, but I believe it can be a nice low cost enhanced alternative to the default 5x5 LED display.

I have published in github at https://github.com/fizban99/microbit_ssd1306

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: SSD1306 library for the micro:bit

Post by deshipu » Fri Feb 24, 2017 12:17 am

Nice!

Did you know that you can now use any two pins for I2C? That means you could use that display without the edge connector.

fizban
Posts: 24
Joined: Mon Oct 24, 2016 2:32 pm

Re: SSD1306 library for the micro:bit

Post by fizban » Fri Feb 24, 2017 7:23 am

According to the documentation, that should be possible, yes, but then you lose the accelerometer and compass functionality.

Besides, in the REPL, if i do:

Code: Select all

>>> from microbit import i2c
>>> dir(i2c)
I only get

Code: Select all

['read', 'write']
Is the init function only available in a later version?

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: SSD1306 library for the micro:bit

Post by deshipu » Fri Feb 24, 2017 7:13 pm

Yes, it was added recently.

fizban
Posts: 24
Joined: Mon Oct 24, 2016 2:32 pm

Re: SSD1306 library for the micro:bit

Post by fizban » Fri Feb 24, 2017 8:58 pm

Well, I am on Windows and both the official version 0.9.13 and version mu-2017-01-29_15_38_04.exe from ardublocky builds show the following

Code: Select all

MicroPython v1.7-9-gbe020eb on 2016-04-18; micro:bit with nRF51822
Type "help()" for more information.
>>> from microbit import i2c
>>> dir(i2c)
['read', 'write']
>>> 
Perhaps you mean a future version of mu not yet released?

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: SSD1306 library for the micro:bit

Post by deshipu » Fri Feb 24, 2017 9:50 pm

It merged in November last year, I'm not sure if this was released already, but I have an impression that there was a release before Christmas. Unfortunately there are no tags in the repository that would signify at which point a release was made, so it's a little hard to say.

fizban
Posts: 24
Joined: Mon Oct 24, 2016 2:32 pm

Re: SSD1306 library for the micro:bit

Post by fizban » Fri Feb 24, 2017 10:39 pm

That was 0.9.13 of mu, yes, but I was not able to find references of the init method in the mu repository. It does noe appear either In the november version of the API definition for code completion. It might be part of the new version of the micropython firmware that solves some pwm issues among others...

Post Reply