from machine import Pin
from utime import sleep
import tm1637 as tm
seg7=tm.TM1637(clk=Pin(0), dio=Pin(1))
button_1=Pin(7,Pin.IN,Pin.PULL_UP)
button_2=Pin(15,Pin.IN,Pin.PULL_UP)
count=0
while 1:
if button_1.value()==0:
count+=1
sleep(0.1)
while button_1.value()==0:
pass
elif button_2.value()==0:
count-=1
sleep(0.1)
while button_2.value()==0:
pass
seg7.number(count)
sleep(0.2)