50 likes | 171 Views
[ Lab14] GPIO Interrupt. Example. GPIO Interrupt. from bbio import * def isr1(): print “isr1 executed” delay(500) def isr2(): print “isr2 executed” delay(500). GPIO Interrupt. def setup(): pinMode(USR3, OUTPUT) pinMode(GPIO1_6, INPUT) pinMode(GPIO1_2, INPUT)
E N D
[Lab14] GPIO Interrupt • Example
GPIO Interrupt from bbio import * def isr1(): print “isr1 executed” delay(500) def isr2(): print “isr2 executed” delay(500)
GPIO Interrupt def setup(): pinMode(USR3, OUTPUT) pinMode(GPIO1_6, INPUT) pinMode(GPIO1_2, INPUT) attachInterrupt(GPIO1_6, isr1, FALLING) attachInterrupt(GPIO1_12, isr2, FALLING) def loop(): toggle(USR3) delay(500) run(setup, loop)