Re: Multithreading-like ideas?
Posted: Fri Mar 17, 2017 4:50 pm
I did not put too much in the timer code which would be disallowed in an ISR. Only stuff like:
or
which returns create or return newly allocated data objects. But in a later version I avoided that, allowing the code to be executed in a Pin ISR handler.
Code: Select all
data = self.i2c.readfrom(self.address, 2)
Code: Select all
return ustruct.unpack('>h', data)[0]