Skip to content

Instantly share code, notes, and snippets.

@jasonblewis
Created September 20, 2018 05:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonblewis/4285f1a08b899d40147a1334ed197e07 to your computer and use it in GitHub Desktop.
Save jasonblewis/4285f1a08b899d40147a1334ed197e07 to your computer and use it in GitHub Desktop.
import machine, time
from ssd1306 import SSD1306_I2C
WIDTH = const(132)
HEIGHT = const (64)
sda_pin = 21
scl_pin = 22
i2c = machine.I2C(scl=scl_pin, sda=sda_pin, speed=400000)
ssd = SSD1306_I2C(WIDTH, HEIGHT, i2c)
import freesans20
from writer import Writer
wri2 = Writer(ssd, freesans20, verbose=True)
Writer.set_clip(True, True)
for y in range(0,HEIGHT-1):
for x in range(0,WIDTH-1):
Writer.set_textpos(x, 0)
wri2.printstring('{} {} MicroPython\nby LoBo\n10/2017'.format(x,y))
ssd.show()
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment