from machine import Pin, I2C
import SSD1306, time
i2c = I2C(0, scl=Pin(16), sda=Pin(17))
oled = SSD1306.SSD1306_I2C(128, 64, i2c)
led = Pin(13, Pin.OUT)
btnPush = Pin(33, Pin.IN)
countPush = 0
while True:
if btnPush.value() == 1:
countPush += 1
if countPush == 2:
oled.fill(0)
countPush = 0
led.value(0)
oled.text("LED APAGADO", 10, 30)
oled.show()
time.sleep(1)
if countPush == 1:
oled.fill(0)
led.value(1)
oled.text("LED ENCENDIDO", 10, 30)
oled.show()
time.sleep(1)