from machine import Pin, SoftI2C
from ssd1306 import SSD1306_I2C
import machine
sdaPIN=machine.Pin(21) #for ESP32
sclPIN=machine.Pin(22)
i2c=machine.I2C(sda=sdaPIN, scl=sclPIN, freq=10000)
I2C_ADDR = 0x3c
oled_width = 128
oled_height = 64
oled= SSD1306_I2C(oled_width,oled_height, i2c, I2C_ADDR)
oled.text('Hello, world 1!', 0, 0, 1)
oled.text('Hello, world 2!', 0, 7)
oled.text('Hello, world 3!', 0, 8)
#devices = i2c.scan()
#if len(devices) == 0:
#print("No i2c device !")
#else:
#print('i2c devices found:',len(devices))
#for device in devices:
#print("At address: ",hex(device))