from machine import Pin, SoftI2C  
from ssd1306 import SSD1306_I2C 
from lcd_api import LcdApi 
from i2c_lcd import I2cLcd 
from time import sleep  
 
# ESP32 Pin assignment  
i2c = SoftI2C(scl=Pin(22), sda=Pin(21), freq=100000)  
# ESP8266 Pin assignment  
#i2c = SoftI2C(scl=Pin(5), sda=Pin(4), freq=100000)  
 
I2C_ADDR1 = 0x3c
I2C_ADDR = 0x27 
oled_width = 128  
oled_height = 64
totalRows = 2 
totalColumns = 16  
oled = SSD1306_I2C(oled_width, oled_height, i2c, I2C_ADDR1)  
 
#oled.invert(True) by default the screen is black so invert method will change the screen color to white
oled.invert(False) 
oled.pixel(21,24,1)
#oled.fill(1)
oled.text('ECE 283!', 0, 0, 1)  
oled.show()

lcd = I2cLcd(i2c, I2C_ADDR, totalRows, totalColumns)

while True: 
	lcd.putstr("ES WITH uPython") 	
	sleep(2) 
	lcd.clear() 
esp:0
esp:2
esp:4
esp:5
esp:12
esp:13
esp:14
esp:15
esp:16
esp:17
esp:18
esp:19
esp:21
esp:22
esp:23
esp:25
esp:26
esp:27
esp:32
esp:33
esp:34
esp:35
esp:3V3
esp:EN
esp:VP
esp:VN
esp:GND.1
esp:D2
esp:D3
esp:CMD
esp:5V
esp:GND.2
esp:TX
esp:RX
esp:GND.3
esp:D1
esp:D0
esp:CLK
oled1:GND
oled1:VCC
oled1:SCL
oled1:SDA
lcd1:GND
lcd1:VCC
lcd1:SDA
lcd1:SCL