adafruit / Adafruit_CircuitPython_RGB_Display

Drivers for RGB displays for Adafruit CircuitPython.
MIT License
129 stars 52 forks source link

SSD1357 #81

Open youssefoumate opened 4 years ago

youssefoumate commented 4 years ago

Can I use adafruit_rgb_display.ssd1351 to control SSD1357 driver?

ladyada commented 4 years ago

you could try it!

youssefoumate commented 4 years ago

I know that ssd1351 and ssd1357 have the same values for the below commands. Do you think that's sufficient to use adafruit_rgb_display.ssd1351 for SSD1357?

_SETCOLUMN = const(0x15) _SETROW = const(0x75) _WRITERAM = const(0x5C) _READRAM = const(0x5D) _SETREMAP = const(0xA0) _STARTLINE = const(0xA1) _DISPLAYOFFSET = const(0xA2) _DISPLAYALLOFF = const(0xA4) _DISPLAYALLON = const(0xA5) _NORMALDISPLAY = const(0xA6) _INVERTDISPLAY = const(0xA7) _FUNCTIONSELECT = const(0xAB) _DISPLAYOFF = const(0xAE) _DISPLAYON = const(0xAF) _PRECHARGE = const(0xB1) _DISPLAYENHANCE = const(0xB2) _CLOCKDIV = const(0xB3) _SETVSL = const(0xB4) _SETGPIO = const(0xB5) _PRECHARGE2 = const(0xB6) _SETGRAY = const(0xB8) _USELUT = const(0xB9) _PRECHARGELEVEL = const(0xBB) _VCOMH = const(0xBE) _CONTRASTABC = const(0xC1) _CONTRASTMASTER = const(0xC7) _MUXRATIO = const(0xCA) _COMMANDLOCK = const(0xFD) _HORIZSCROLL = const(0x96) _STOPSCROLL = const(0x9E) _STARTSCROLL = const(0x9F)

ladyada commented 4 years ago

no idea, you would have to try it

youssefoumate commented 4 years ago

This is the code that I'm using to display something on my OLED (SSD1357), but it doesn't seem to be working:

import busio
import time
import digitalio
import board
from adafruit_rgb_display import color565
import adafruit_rgb_display.ssd1351 as ssd1351

CS_PIN = board.D8 
DC_PIN = board.D25
RESET_PIN = board.CE0_1
BAUDRATE = 24000000
spi = busio.SPI(clock=board.SCK, MOSI=board.MOSI, MISO=board.MISO)
display = ssd1351.SSD1351(
spi,
rotation=90, 
width=64, 
height=64,
baudrate=BAUDRATE,
cs=digitalio.DigitalInOut(CS_PIN),
dc=digitalio.DigitalInOut(DC_PIN), 
rst=digitalio.DigitalInOut(RESET_PIN))
while True:
    display.fill(0)
    display.pixel(32, 32, color565(255,0,0))
    time.sleep(2)
    display.fill(color565(0,0,255))
    time.sleep(2)
makermelissa commented 4 years ago

Try it slower. I know the SSD1351 did not like going above 16MHz.

youssefoumate commented 4 years ago

I decreased it to 13MHz, still not working. Sorry, I know this question is a bit far from the topic, but when I connect the OLED breakout to the Jetson Nano, the OLED starts getting extremely hot. Do you think that's normal?

makermelissa commented 4 years ago

No, probably not normal.