Library guidelines
Posted: Wed May 07, 2014 7:29 pm
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:
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?
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()
Maybe a folder per library with in that folder the py file(s) and a readme with more information.
Any suggestions?