py-gaugette icon indicating copy to clipboard operation
py-gaugette copied to clipboard

Support For AdaFruit Monochrome 128x32 I2C OLED Graphic Display

Open napperley opened this issue 10 years ago • 12 comments

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?

napperley avatar Apr 22 '14 07:04 napperley

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.

guyc avatar Apr 26 '14 05:04 guyc

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.

domgiles avatar Jun 01 '14 14:06 domgiles

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

guyc avatar Jun 02 '14 10:06 guyc

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

shadowfxd avatar Feb 09 '17 03:02 shadowfxd

Are those the only two options?

guyc avatar Feb 09 '17 03:02 guyc

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.

shadowfxd avatar Feb 09 '17 03:02 shadowfxd

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

plugowski avatar Feb 21 '18 21:02 plugowski

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 ?

kflmiami420 avatar Aug 21 '19 18:08 kflmiami420

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

guyc avatar Aug 21 '19 20:08 guyc

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 avatar Aug 21 '19 21:08 kflmiami420

#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:

  • draw.rectangle(device.bounding_box, outline="white", fill="black")

  • draw.text((8, 1), "Raspberry Pi Zero W ", fill="white")

  • draw.text((8, 9), "Temperature:86.6 F ", fill="white")

  • draw.text((8, 18),"Pressure:30.0 inHg ", fill="white")

  • draw.text((8, 27),"Pressure:1015.6 hPa ", fill="white")

  • draw.text((8, 36),"Humidity:30.1 % ", fill="white")

  • draw.text((8, 45),"Altitude :-18.80 m ", fill="white")

  • draw.text((8, 53),"Time 9:34am 8/3/19 ", fill="white")

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:

  • print("Raspberry Pi Zero W ")
    
  • print("Temperature: %0.1f F" % bme280.temperature2)
    
  • print("Pressure: %0.1f inHg" % inchesHg)
    
  • print("Pressure: %0.1f hPa" % bme280.pressure)
    
  • print("Humidity: %0.1f %%" % bme280.humidity)
    
  • print("Pressure: %0.1f hPa" % bme280.pressure)
    
  • print("Altitude = %0.2f meters" % bme280.altitude)
    
    time.sleep(2)

kflmiami420 avatar Aug 21 '19 22:08 kflmiami420

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

guyc avatar Aug 22 '19 04:08 guyc