from machine import Pin, I2C
import ssd1306
from time import sleep as retardo
# Actividad agregar otro contador
i2c = I2C(0, scl=Pin(17), sda=Pin(16))
oled = ssd1306.SSD1306_I2C(128,64,i2c)
oled.fill(0)
oled.hline(0,10,128,1)
oled.hline(0,55,128,1)
oled.vline(117,10,64,1)
oled.vline(10,10,64,1)
oled.text("Contador 1",15,0)
oled.text("Contador 2",15,40)
contador1 = 0
contador2 = 0
oled.show()
while (True):
# Actualiza el contador 1
oled.fill_rect(60,25,40,10,0)
oled.text(str(contador1),60,25)
contador1 += 1
# Actualiza el contador 2
oled.fill_rect(60,50,40,10,0)
oled.text(str(contador2),60,50)
contador2 += 1
retardo(1)
oled.show()