i try to register a user defined function for a periodic timer interupt on the wipy.
This works:
Code: Select all
tim = Timer(1, mode=Timer.PERIODIC)
tim_a = tim.channel(Timer.A, freq=700)
tim_a.irq(handler=lambda t: pin_step.toggle())
This not. There is no error, the wipy just seems to ignore the handler silently.:
Code: Select all
def stepnext():
pin_step.toggle()
tim = Timer(1, mode=Timer.PERIODIC)
tim_a = tim.channel(Timer.A, freq=700)
tim_a.irq(handler=lambda t: stepnext())
#I also tried this:
#tim_a.irq(handler=stepnext())
Thanks Thilo