Hello all.
I am making my own weather station and am using an OLED at the sensor end.
I have borrowed from the CORE site and several contributors various code packages. Thank you.
The oled text is almost unreadable from a distance.
The following files were contributed by ??? PiicoDev_SSD1306_Large.py SSD1306_Large.py
An additional file gave an option for scrolling see link below.
With some perseverance I adapted to created file below.
The combination give me the 3 lines of 8 characters that scroll for what ever length of text. For my project I am happy with the end result.
The print lines are for error checking.
Apologies for this presentation as I am not experienced in the art of creating a topic.
Thank you to the earlier contributors and welcome any comments.
BC
from SSD1306_Large import SSD1306_8x3
import time
display = SSD1306_8x3()
def scroll_text(text1):
display.Clear()
loop = len(text1) - 1
for i in range(len(text1) - loop):
#display.Clear()
#display.line1(text)
n=0
while n < len(text1):
#print(text1[n], end = "")
time.sleep(0.2)
display.Clear()
text = (text1[n:n + 8])
display.line1(text)
display.line2(text)
display.line3(text)
#print(text, end = "")
display.Show()
n += 2
#display.line1(text[n])
#display.line1('Hello') #(text, x, y, 1)
#display.line2('01234567')
#display.line3(',!?/:+-=')
#display.Show()
scroll_text('This is some text scrolling across the display!')
#scroll_text('XAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA')
Thanks for documenting your solution @Bryan160034 It’s pretty slick to just be able to use a different version of the driver library for your text and make no changes to the user code-
nice!
Where did you get the alternative driver files from? You might have forgotten to paste some links into your original post - it’d be great to share for other community members
It might also be worth checking out the PiicoDev Community Contributions where Mark Gladding presents a pretty gorgeous packed-font extension for the OLED. If you want to make custom fonts as well, this might be helpful to squeeze every useful pixel out of your PiicoDev OLED module.
I have used the library linked by @Bryan160034 successfully in a number of projects.
The original PiicoDev library was only modified to remove the non Pico parts to reduce its size.
It works as supplied by Core Electronics with my library on a Pi Pico. Have not tested on any other device.
My library simply draws lines to make characters, all uppercase, numbers and a few special characters are represented.