desarrollo:edu-ciaa:edu-ciaa-nxp:python:bibliotecas:modulo-pyb-extint
Soporte interrupciones en GPIOs: Clase ExtInt
import pyb
def callBack(line):
print("Pin Interrupt!")
print("Line = ",line)
p = pyb.Pin(8)
p.init(pyb.Pin.OUT_PP,pyb.Pin.PULL_NONE)
print(p)
int = pyb.ExtInt(p,pyb.ExtInt.IRQ_RISING,pyb.Pin.PULL_NONE,callBack)
print(int)
while True:
pyb.delay(1000)
print("tick")
Existen 4 interrupciones disponibles para asignar a cualquiera de las 9 GPIOs Se implementaron los métodos:
- enable()
- disable()
- swint()
- line()
Mas info en : pyb.ExtInt
desarrollo/edu-ciaa/edu-ciaa-nxp/python/bibliotecas/modulo-pyb-extint.txt · Última modificación: 2016/10/08 19:18 por egigliotti