Skip to content

Instantly share code, notes, and snippets.

@joeycastillo
Created November 2, 2024 23:21
Show Gist options
  • Save joeycastillo/d8500d1677aa80ae33a19cdbc90ce388 to your computer and use it in GitHub Desktop.
Save joeycastillo/d8500d1677aa80ae33a19cdbc90ce388 to your computer and use it in GitHub Desktop.
from machine import Pin, I2C
import time
# Simple "Sensor Watch" SAO example.
# You can paste this at the beginning of your main.py, and then run the rest of your loop normally.
# For a more advanced example: https://gist.github.com/joeycastillo/a617c949258fae4e5e333eaeb06b102a
# right side I2C, replace with i2c0 for left side
display_i2c = i2c1
display_i2c.writeto(0x3E, bytes([0xC8])) # configure the display
display_i2c.writeto(0x3E, bytes([0, 0b00001010, 0b10111101, 0b11101011, 0b11101011, 0b11101110, 0])) # "12:00A"
display_i2c.writeto(0x3E, bytes([0xF2])) # Enable blinking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment