# Test the I2C connections
# Tony Goodhew - 1st Jan 2024 - for thepihut.com
import time
from machine import Pin, I2C, ADC
import ssd1306
import array # Needed for polygons
WIDTH = 128 # oled display width
HEIGHT = 64 # oled display height
sda=machine.Pin(8) # Data pin
scl=machine.Pin(9) # Clock pin
i2c=machine.I2C(0,sda=sda, scl=scl, freq=400000) # Connection controller 0
oled = ssd1306.SSD1306_I2C(128, 64, i2c) # Initialise ssd1306 display
# ======== ssd1306 set up for I2C ========
# ====== Universal code starts here ======
oled.fill(0) # Clear screen to BLACK
oled.text("Hello World",15,15,1) # Draw text in buffer - WHITE
oled.show() # Display the buffer