Skip to content

Instantly share code, notes, and snippets.

@sweemeng
Created July 23, 2016 11:12
Show Gist options
  • Save sweemeng/2d1427fb8d279dde0945921c23de5421 to your computer and use it in GitHub Desktop.
Save sweemeng/2d1427fb8d279dde0945921c23de5421 to your computer and use it in GitHub Desktop.
micropython ssd1306 test using library build into micropython
import ssd1306
from machine import I2C, Pin
import math
i2c = I2C(sda=Pin(4), scl=Pin(5))
display = ssd1306.SSD1306_I2C(64, 48, i2c, 60)
display.fill(0)
display.show()
for x in range(0, 96):
display.pixel(x, 16+int(math.sin(x/32*math.pi)*7 + 8), 1)
display.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment