Created
July 23, 2016 11:12
-
-
Save sweemeng/2d1427fb8d279dde0945921c23de5421 to your computer and use it in GitHub Desktop.
micropython ssd1306 test using library build into micropython
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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