1# check basic functionality of the timer class 2 3import pyb 4from pyb import Timer 5 6tim = Timer(4) 7tim = Timer(4, prescaler=100, period=200) 8print(tim.prescaler()) 9print(tim.period()) 10tim.prescaler(300) 11print(tim.prescaler()) 12tim.period(400) 13print(tim.period()) 14 15# Setting and printing frequency 16tim = Timer(2, freq=100) 17print(tim.freq()) 18tim.freq(0.001) 19print("{:.3f}".format(tim.freq())) 20