import machine
from machine import Pin
import time
boton_verde = Pin(6, Pin.IN, Pin.PULL_UP)
boton_rojo = Pin(5, Pin.IN, Pin.PULL_UP)
contador = 0
while True:
if not boton_rojo.value():
contador = contador + 1
print ("Contador = "+str(contador))
time.sleep(0.2)
if not boton_verde.value():
contador = contador - 1
print ("Contador = "+str(contador))
time.sleep(0.2)