from machine import Pin
import time
button 1=Pin (18, Pin.IN, Pin.PULL UP)
button 2=Pin (33, Pin.IN, Pin.PULL UP)
def stopwatch ():
minute=0
start=time.ticks ms()
while True:
C= button 2.value()
time.sleep(0.01)
D= button 2.value()
if C and not D:
break
elif not C and D:
pass
end=time.ticks ms()
second=time.ticks diff(end,start)
time.sleep ms()
if second > 59999:
minute += 1
start=time.ticks ms()
display=start(minute)+":"+start(second/1000)
print(display)
while True
A = button 1.value()
time.sleep(0.01)
B = button 1.value()
if A and not B:
stopwatch
elif not A and B:
pass