Page 1 of 1

SSD1306 library for the micro:bit

Posted: Thu Feb 23, 2017 11:22 pm
by fizban
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

Re: SSD1306 library for the micro:bit

Posted: Fri Feb 24, 2017 12:17 am
by deshipu
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.

Re: SSD1306 library for the micro:bit

Posted: Fri Feb 24, 2017 7:23 am
by fizban
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?

Re: SSD1306 library for the micro:bit

Posted: Fri Feb 24, 2017 7:13 pm
by deshipu
Yes, it was added recently.

Re: SSD1306 library for the micro:bit

Posted: Fri Feb 24, 2017 8:58 pm
by fizban
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?

Re: SSD1306 library for the micro:bit

Posted: Fri Feb 24, 2017 9:50 pm
by deshipu
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.

Re: SSD1306 library for the micro:bit

Posted: Fri Feb 24, 2017 10:39 pm
by fizban
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...