from machine import Pin
from time import sleep_ms
import segment
pins = [2, 4, 16, 17, 5, 18, 19]
INC_BTN = 25
DEC_BTN = 26
RESET_BTN = 27
inc_btn = Pin(INC_BTN, Pin.IN, Pin.PULL_UP)
dec_btn = Pin(DEC_BTN, Pin.IN, Pin.PULL_UP)
reset_btn = Pin(RESET_BTN, Pin.IN, Pin.PULL_UP)
counter = 0
while True :
if inc_btn.value() == 0:
counter = counter + 1
sleep_ms(200)
if dec_btn.value() == 0:
counter = counter - 1
sleep_ms(200)
if reset_btn.value() == 0:
counter = 0
sleep_ms(200)
if counter > 9:
counter = 9
if counter < 0:
counter = 0
segment.segment_write(counter)