import machine
from machine import Pin, SoftI2C
from ssd1306 import SSD1306_I2C
from lcd_api import LcdApi
from i2c_lcd import I2cLcd
from time import sleep
OLED_ADDR = 0x3C
LCD_ADDR = 0x27
i2c = SoftI2C(scl=Pin(22), sda=Pin(21), freq=100000) #initializing the I2C method for ESP32
i2cLCD = SoftI2C(scl=Pin(22), sda=Pin(21), freq=10000) #initializing the I2C method for ESP32
#i2c = I2C(scl=Pin(5), sda=Pin(4), freq=10000) #initializing the I2C method for ESP8266
oled_width = 128
oled_height = 64
totalRows = 2
totalColumns = 16
oled = SSD1306_I2C(oled_width, oled_height, i2c, OLED_ADDR)
lcd = I2cLcd(i2cLCD, LCD_ADDR, totalRows, totalColumns)
# oled.fill(1)
# oled.invert(0)
oled.pixel(110,27,1)
oled.text('ECE 283!', 0, 0)
oled.show()
lcd.move_to(0,0)
lcd.putstr("Embedded System With MicroPython")