Skip to content

Instantly share code, notes, and snippets.

@vestige
Created December 27, 2025 06:53
Show Gist options
  • Select an option

  • Save vestige/d33ad7c97069542f30d5dd1375eb7b69 to your computer and use it in GitHub Desktop.

Select an option

Save vestige/d33ad7c97069542f30d5dd1375eb7b69 to your computer and use it in GitHub Desktop.
from machine import Pin, I2C
from ssd1306 import SSD1306_I2C
# I2C設定
i2c = I2C(0, scl=Pin(1), sda=Pin(0))
# OLEDディスプレイの初期化
oled = SSD1306_I2C(128, 64, i2c)
# 画面をクリア
oled.fill(0)
# テキストを表示
oled.text('SSD1306 OLED', 0, 10) # テキストを(0, 10)の位置に表示
oled.text('Pico W', 40, 35) # テキストを(40, 35)の位置に表示
# 画面を更新してテキストを表示
oled.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment