from machine import Pin, I2C
import ssd1306
from time import sleep_ms
from random import random
# ESP32 Pin assignment
i2c = I2C(0, scl=Pin(22), sda=Pin(21))
oled_width = 128
oled_height = 64
oled = ssd1306.SSD1306_I2C(oled_width, oled_height, i2c)
aumentar = Pin(32, Pin.IN, Pin.PULL_UP)
reducir = Pin(25, Pin.IN, Pin.PULL_UP)
while True:
if aumentar.value() == 0:
oled.text("Boton 1", 10, 20, 1)
else:
oled.text("Boton 1", 10, 20, 0)
if reducir.value() == 0:
oled.text("Boton 2", 10, 40, 1)
else:
oled.text("Boton 2", 10, 40, 0)
oled.show()