# Hungry-Hungry Hippo (Take 1) from machine import Pin import time N1 = 0 N2 = 0 pin1 = Pin(15,Pin.IN,Pin.PULL_UP) pin2 = Pin(14,Pin.IN,Pin.PULL_UP) def player1(pin1): global N1 N1 = N1 + 1 def player2(pin2): global N2 N2 = N2 + 1 pin1.irq(trigger=Pin.IRQ_FALLING, handler=player1) pin2.irq(trigger=Pin.IRQ_FALLING, handler=player2) Time = 0.0 while (Time < 10): print(Time, N1, N2) Time += 0.1 time.sleep(0.1)