Hello,
I searched inside the forum but nothing seems to work for me.
I have a scree Adafruit 0.96" I2C IIC OLED SSD1306.
I want to make it works with my LibreELEC. For this moment, I only want to display the current hour but I want to display more later.
I have LibreELEC 9.0.2
I installed the Adafruit Librairies v9.0.107 and Raspberry Pi Tools v9.0.106 and System Tools v9.0.111
I tested my screen with Raspbian and the screen was working well. So, I know that the device is plugged correctly and working.
When I switched to LibreELEC : nothing run... And I reboot many times.
I set the /flash/config.txt file to add :
dtparam=i2c_arm=on
I test the I2C device with : i2cdetect -y 1 and I got this result:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
I tested many scripts, but the following below is my "test only" script.
When I run it, I get not error but the screen I2C stays black.
I'm programming with many languages but I never use Python, it's my first time. So, probably I missed something simple..
I need help...
Thanks.
import time
import sys
sys.path.append('/storage/.kodi/addons/virtual.rpi-tools/lib')
sys.path.append('/storage/.kodi/addons/virtual.adafruit-libraries/lib')
import Adafruit_GPIO
import Adafruit_SSD1306
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
import subprocess
disp = Adafruit_SSD1306.SSD1306_128_64(rst=None)
disp.begin()
disp.clear()
disp.display()
width = disp.width
height = disp.height
image = Image.new('1', (width, height))
draw = ImageDraw.Draw(image)
font = ImageFont.load_default()
draw.text((1, 1), str("This is a test"), font=font, fill=255)
disp.image(image)
disp.display()
Display More