from machine import Pin,I2C
from utime import sleep, sleep_ms
from ssd1306 import SSD1306_I2C
ancho = 128
alto = 64
i2c=I2C(0, scl=Pin(21), sda=Pin(20))
oled = SSD1306_I2C(ancho, alto, i2c)
director= Pin(2, Pin.IN)
vice= Pin(3, Pin.IN)
secretario= Pin(4, Pin. IN)
jefe= Pin(5, Pin. IN)
print(i2c.scan(),"Conectada")
while True:
oled.fill(0)
oled.text("Dir:", 0, 0, 1)
oled.text("Vice:", 0, 10, 1)
oled.text("Secre", 0, 20, 1)
oled.text("Jefe:", 0, 30, 1)
oled.text("Aprob:", 0, 40, 1)
if director.value() == 1 and vice.value() == 1 and secretario.value==1 and jefe.value==1:
oled.text("45%", 60, 0, 1)
oled.text("30%", 60, 10, 1)
oled.text("15%", 60, 20, 1)
oled.text("10%", 60, 30, 1)
oled.text("Si:", 60, 40, 1)
oled.show()
## falta completar otros elif
else:
oled.text("0%", 60, 0, 1)
oled.text("0%", 60, 10, 1)
oled.text("0%", 60, 20, 1)
oled.text("0%", 60, 30, 1)
oled.text("No:", 60, 40, 1)
oled.show()
sleep_ms(50)