guyc / py-gaugette

Python library to support building hardware gadgets with the Raspberry Pi and BeagleBone Black
http://guy.carpenter.id.au/gaugette/
GNU Lesser General Public License v3.0
121 stars 44 forks source link

Support For AdaFruit Monochrome 128x32 I2C OLED Graphic Display #11

Open napperley opened 10 years ago

napperley commented 10 years ago

Although there is support for the AdaFruit Monochrome 128x32 SPI OLED Graphic Display the I2C version isn't supported:

http://www.adafruit.com/products/931

Support is needed for the use of the I2C version in the Beaglebone Black. Is it possible for py-gaugette / gaugette / ssd1306.py module to be adapted to support the I2C version?

guyc commented 10 years ago

Yes, it is certainly possible. The original Arduino library that this library is based on supports both SPI and I²C, but I didn't port the I²C code across because I didn't have an I²C display to verify with. I bought one a while ago expressly to test with, but haven't yet done the port, and don't know when I will get a chance to do so. If you feel like contributing let me know - it shouldn't be very hard.

domgiles commented 10 years ago

Hi Guy... Have you made any progress on the I2C support? It partially works already. It will occasionally start with pixels all over the screen and then carry on working after a reset. I know it's selfish of me but I've most got I2C displays.

guyc commented 10 years ago

Sorry, haven't got to this yet, but hopefully I will soon.

shadowfxd commented 7 years ago

is this a dead project or does it take years to port the i2c to Raspberry Pi?

guyc commented 7 years ago

Are those the only two options?

shadowfxd commented 7 years ago

no idea, just wanted to use your drivers on my i2c OLED screen, but they're not finished yet, or ever? Would really appreciate if you could port over the i2c drivers though.

plugowski commented 6 years ago

Hi, I found your library and it will be nice to get support for I2C displays as well 👍

kflmiami420 commented 5 years ago

Hi I wanted to know if they also could be supported because I am running a PizeroW pihole with a 128x32 oled i2c and wanted to also use the library

please let me know if its possible ?

guyc commented 5 years ago

You might try using this fork: https://github.com/sorki/py-gaugette/tree/i2cssd

kflmiami420 commented 5 years ago

Hi Guyc I tried but that repo is 6 plus years old and it does not support the SSD1306.SH1106 in python3 . I have two scripts one for the SH1106 working on python3 but it just prints text and the other script is for a sensor so it can display the output to the screen . Do you know how to combine them to work by any chance ?

kflmiami420 commented 5 years ago

SH1106 OLED CODE

from luma.core.interface.serial import i2c from luma.core.render import canvas from luma.oled.device import ssd1306, sh1106 import time

serial = i2c(port=1, address=0x3C) device = sh1106(serial, rotate=0)

with canvas(device) as draw:

while 1: time.sleep(.1)

###################################################

August 2019 gy-bme280 loop correct formulas

import board import digitalio import busio import time import adafruit_bme280

i2c = busio.I2C(board.SCL, board.SDA) bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)

bme280.sea_level_pressure = 1013.25

bme280.temperature2 = (bme280.temperature 1.8 ) + 32 hectopascals = bme280.pressure pascals = hectopascals 100 inchesHg = (pascals /3386.39) mbar = (inchesHg * 33.8639)

while True:

guyc commented 5 years ago

Sorry, wish I could help, but I don't have capacity right now.