from machine import Pin, I2C
import ssd1306
# Initialize the I2C interface for communication with the OLED display
# ESP32 Pin assignment:
# scl (clock) is connected to GPIO 22
# sda (data) is connected to GPIO 21
i2c = I2C(0, scl=Pin(22), sda=Pin(21))
# Define the width and height of the OLED display
oled_width = 128
oled_height = 64
# Initialize the OLED display with the I2C interface, specifying its width and height
oled = ssd1306.SSD1306_I2C(oled_width, oled_height, i2c)
# Display the text 'Namaste!' at coordinates (10, 10) on the OLED screen
oled.text('Namaste!', 10, 10)
# Update the display to show the text
oled.show()