import utime
from machine import Pin
count_bt_1 = 0
count_bt_2 = 0
stat_bt1 = None
stat_bt2 = None
p4 = Pin(4, Pin.IN)
p5 = Pin(2, Pin.IN)
p6 = Pin(6, Pin.IN)
def callback_rst(pPin):
count_bt_1 = 0
count_bt_2 = 0
def callback_bt1(pPin):
#utime.sleep(1)
stat_bt1 = p4.value()
print(''.join([str(x) for x in ['Stat_BT1: {', stat_bt1, ',', count_bt_1, '}']]))
def callback_bt2(pPin):
#utime.sleep(1)
stat_bt2 = p5.value()
print(''.join([str(x2) for x2 in ['Stat_BT2: {', stat_bt2, ',', count_bt_2, '}']]))
p4.irq(trigger=Pin.IRQ_FALLING, handler=callback_bt1)
p5.irq(trigger=Pin.IRQ_FALLING, handler=callback_bt2)
p6.irq(trigger=Pin.IRQ_RISING | Pin.IRQ_FALLING, handler=callback_rst)