from utime import sleep
import tm1637
from machine import Pin
tm = tm1637.TM1637(clk=Pin(2), dio=Pin(3))
button1 = Pin(6, Pin.IN, Pin.PULL_UP) #Count up enable internal pull-up resistor
button2 = Pin(12, Pin.IN, Pin.PULL_UP) #Count down enable internal pull-up resistor
count=0
while 1:
if button1.value()==0:
count=count+10
if count>100:
count=100 #max value
sleep(0.5)
if button2.value()==0:
count=count-1
if count<-100:
count=-100 #min value
sleep(0.5)
tm.number(count)