Page 1 of 1

Library guidelines

Posted: Wed May 07, 2014 7:29 pm
by Kenneth
I just wrote a first quick version for a library for SSD1306 oled displays (128x64 and 128x32), tested for 128x32.

The file is called ssd1306.py and you can place it next to your main.py. after that, you can use code like:

Code: Select all

from ssd1306 import SSD1306
display = SSD1306(pinout={'sda': 'Y1',
                          'sck': 'Y2',
                          'dc': 'Y3',
                          'res': 'Y4',
                          'cs': 'Y5'},
                  external_vcc=True)

current = False
try:
  display.poweron()
  display.init_display()
  
  while True:
    current = not current
    display.set_pixel(0, 0, current)
    display.display()
    pyb.delay(1000)
except:
  display.poweroff()
However, what are the guidelines to contribute libraries (in this case, the ssd1306.py file)? I could not find a proper location in the repo, or should we create a new repo with various libraries that people can use?

Maybe a folder per library with in that folder the py file(s) and a readme with more information.

Any suggestions?

Re: Library guidelines

Posted: Wed May 07, 2014 7:41 pm
by pfalcon
A suggestion is to do the same as general Python community does - make your module easily available to the rest community (e.g. via PyPI), but maintain it yourself. There're already proof-of-concept support for installing modules from PyPI, number of modules posted already as part of http://forum.micropython.org/viewtopic.php?f=5&t=70 project, and RFC for packaging guidelines at https://github.com/micropython/micropython/issues/413 .

Re: Library guidelines

Posted: Fri Aug 08, 2014 2:56 pm
by domgiles
Hi Kenneth

Is this the I2C variants of the SSD1306 displays. I'd be really interested in using it/contributing.

Thanks

Dom

Re: Library guidelines

Posted: Fri Aug 08, 2014 4:24 pm
by Turbinenreiter
What I do is to just create a Github repository and post links to the wiki and in the forum.

See http://forum.micropython.org/viewtopic.php?f=5&t=226


However, maybe it would be a good idea to create an 'micropython-devlib' repository in the micropython account (https://github.com/micropython).
Having everything in one place would help with two things:
1. Finding stuff is easier, so you won't start hacking on a module to just find out that someone already did it later.
2. Consistency. People would see other modules and talk to other authors, leading to more consistent modules.

Maintaining would be tricky, tough.