User Tools

Site Tools


using_pico_with_ssd1306_based_lcd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next 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!!!] walkeradminusing_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.
 +\\ 
 +\\ 
 +{{ :64x128-oled-screen-split.png?200 |}}
 +\\ 
 +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.
 +
 +<code:python | download>
 +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, 64, i2c)
 +
 +lcd.fill(0)
 +lcd.text("Yo Tuesday Club!", 0, 0)
 +lcd.text("SSD1306 LCD",      0, 8)
 +lcd.text("Address 0x3C",     0, 16)
 +lcd.text("Cool :)",          0, 24)
 +lcd.text("Another Line :)",  0, 32)
 +lcd.text("One More? :)",     0, 40)
 +lcd.text("Line 7",           0, 48)
 +lcd.text("Line 8",           0, 56)
 +lcd.show()
 +
 +time.sleep(300)
 +lcd.fill(0)
 +lcd.show()
 +</code>
 +
 +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