Created
December 31, 2022 17:02
-
-
Save bmidgley/e0a2fe3c82822dd0e29a568e9cbccdab to your computer and use it in GitHub Desktop.
show micropython welcome on boot (esp8266 + 1306)
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
# This file is executed on every boot (including wake-boot from deepsleep) | |
#import esp | |
#esp.osdebug(None) | |
import uos, machine | |
#uos.dupterm(None, 1) # disable REPL on UART(0) | |
import gc | |
from machine import Pin, I2C | |
import ssd1306 | |
# using default address 0x3C | |
i2c = I2C(sda=Pin(5), scl=Pin(4)) | |
display = ssd1306.SSD1306_I2C(128, 64, i2c) | |
display.fill(0) | |
display.fill_rect(0, 0, 32, 32, 1) | |
display.fill_rect(2, 2, 28, 28, 0) | |
display.vline(9, 8, 22, 1) | |
display.vline(16, 2, 22, 1) | |
display.vline(23, 8, 22, 1) | |
display.fill_rect(26, 24, 2, 4, 1) | |
display.text('MicroPython', 40, 0, 1) | |
display.text('v1.19.1', 40, 12, 1) | |
display.text('1306@128x64', 40, 24, 1) | |
display.show() | |
#import webrepl | |
#webrepl.start() | |
gc.collect() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment