Search found 2 matches

by jaggr
Mon Aug 05, 2019 5:03 am
Forum: MicroPython pyboard
Topic: Call next() from a callback
Replies: 3
Views: 149

Re: Call next() from a callback

... The easiest way around this is to use micropython.schedule from the interrupt handler to set a callback (a "soft" interrupt) that will be executed by the VM between instructions ASAP. These soft handlers can do everything that normal code can do. See https://docs.micropython.org/en/latest/refer...
by jaggr
Fri Aug 02, 2019 1:38 pm
Forum: MicroPython pyboard
Topic: Call next() from a callback
Replies: 3
Views: 149

Call next() from a callback

I want to get the values of a cosine function in small steps and a regular interval. To not calculate all values in advance and overfill the memory, I use a generator. To get a regular value I use a timer as trigger. Now my problem is, if I call next value in the callback function, I get the followi...