Now my question: How can I force my pyboard to run the same piece of code every 100 milliseconds?
Here is my code thus far:
Code: Select all
import pyb
def callbackfunction():
time = round(pyb.millis()/1000, 4)
return time
timelist = []
timer_object = pyb.Timer(4, freq=10) # Create a timer object using internal timer #4 with 10 [Hz]
current_time = timer_object.callback(callbackfunction())
timelist.append(current_time)