I saw that the Transparent Graphical OLED Breakout (https://www.sparkfun.com/products/15173) had examples of being used with an Arduino microcontroller. I was wondering if is compatible with any version of the Raspberry Pi, and, if so, if there are any examples of it being used.
Hi Saptarshi2019,
Unfortunately, we do not currently have any Python examples to use the [Transparent Graphical OLED with a Raspberry Pi. With the right connections and code, it could work on a Pi but we cannot help with custom code. The [Software Setup and Programming section of the Hookup Guide would be a good place to start if you want to give it a try.](https://learn.sparkfun.com/tutorials/transparent-graphical-oled-breakout-hookup-guide#software-setup-and-programming)](https://www.sparkfun.com/products/15173)
Hi,
I was able to use it with the luma.oled library
https://luma-oled.readthedocs.io/en/latest/
#!/usr/bin/python
import struct
import random
from demo_opts import get_device
from luma.core.render import canvas
from PIL import Image, ImageDraw, ImageFont
import sys
device = get_device(["--display", "ssd1309"])
#device = get_device()
offset = (0, 0)
def main():
global device
device.contrast(0)
i = 0
while True:
with canvas(device) as draw:
if i > 300:
i = 0
draw.text(offset, "{:>3}".format(i), fill="white", align="left", spacing=-1)
i += 1
if __name__ == '__main__':
try:
main()
except (KeyboardInterrupt, SystemExit) as exErr:
print("\nEnding OLED Hello Example")
sys.exit(0)