using_pico_with_ssd1306_based_lcd
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| using_pico_with_ssd1306_based_lcd [2026/08/17 10:46] – [Oh No!!! I don't have an LCD to play with yet!!!] walkeradmin | using_pico_with_ssd1306_based_lcd [2026/08/19 19:36] (current) – [Something Quirky with this OLED Screen] walkeradmin | ||
|---|---|---|---|
| Line 71: | Line 71: | ||
| * Pin 6 = GPIO4 (SDA) | * Pin 6 = GPIO4 (SDA) | ||
| - | * Pin 7 = GPIO4 (SCL) | + | * Pin 7 = GPIO5 (SCL) |
| - | \\ | + | |
| - | \\ | + | |
| ---- | ---- | ||
| ==== The Micro Python Code ==== | ==== The Micro Python Code ==== | ||
| Line 269: | Line 268: | ||
| \\ | \\ | ||
| I hope you find this wiki article useful :) | I hope you find this wiki article useful :) | ||
| + | \\ | ||
| + | \\ | ||
| + | ---- | ||
| + | ==== Something Quirky with this OLED Screen ==== | ||
| + | \\ | ||
| + | So I have noticed something a little quirky with this LCD Panel. It seems to be in two parts, let me explain. | ||
| + | \\ | ||
| + | \\ | ||
| + | The Yellow section of the panel is 16 pixels high, then there seems to be a hard barrier between there and the Blue section which is 48 pixels high. | ||
| + | \\ | ||
| + | \\ | ||
| + | {{ : | ||
| + | \\ | ||
| + | So you can move text vertically up and down the screen, but not through the join in the yellow/blue part, the text will get chopped off. So you will have to think about the screen as two parts. | ||
| + | \\ | ||
| + | \\ | ||
| + | Below is some code where you can squeeze 8 lines of text on to this little OLED. Each line the text is 6 pixels tall, and there is a two pixel gap between each line. Effectively each line takes 8 pixels, so 8 lines = 8linex8Pixel = 64 pixels, the exact LCD height. | ||
| + | |||
| + | < | ||
| + | from machine import Pin, I2C | ||
| + | import ssd1306 | ||
| + | import time | ||
| + | |||
| + | i2c = I2C(0, scl=Pin(5), sda=Pin(4), freq=200000) | ||
| + | lcd = ssd1306.SSD1306_I2C(128, | ||
| + | |||
| + | lcd.fill(0) | ||
| + | lcd.text(" | ||
| + | lcd.text(" | ||
| + | lcd.text(" | ||
| + | lcd.text(" | ||
| + | lcd.text(" | ||
| + | lcd.text(" | ||
| + | lcd.text(" | ||
| + | lcd.text(" | ||
| + | lcd.show() | ||
| + | |||
| + | time.sleep(300) | ||
| + | lcd.fill(0) | ||
| + | lcd.show() | ||
| + | </ | ||
| + | |||
| + | The LCD can have 16 characters across, so the characters are 8 pixels wide. So 16char x 8pixel =128 Pixels wide. | ||
| + | \\ | ||
| + | \\ | ||
| + | Using the code above, feel free to change the text and have a play, also play with the line spacing to explore the Yellow/Blue section limitation, each line is moved down by 8 pixels in the script, but have a play with these values to see what fits for you. | ||
| \\ | \\ | ||
| \\ | \\ | ||
| ---- | ---- | ||
using_pico_with_ssd1306_based_lcd.1786963584.txt.gz · Last modified: by walkeradmin
