import pcf8575
from machine import Pin, I2C
# ESP32
i2c = I2C(scl=Pin(22), sda=Pin(21))
pcf = pcf8575.PCF8575(i2c, 0x20)
# set P00 HIGH and all other pins LOW
# turn LED on
pcf.port = 0x0001
print("led on")
# turn LED off
pcf.port = 0x0000
import pcf8575
from machine import Pin, I2C
# ESP32
i2c = I2C(scl=Pin(22), sda=Pin(21))
pcf = pcf8575.PCF8575(i2c, 0x20)
# set P00 HIGH and all other pins LOW
# turn LED on
pcf.port = 0x0001
print("led on")
# turn LED off
pcf.port = 0x0000