File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -86,8 +86,10 @@ Use the ``machine.Timer`` class::
8686 from machine import Timer
8787
8888 tim = Timer(0)
89- tim.init(period=10, mode=Timer.ONE_SHOT, callback=lambda t:print(1))
90- tim.init(period=1, mode=Timer.PERIODIC, callback=lambda t:print(2))
89+ tim.init(period=5000, mode=Timer.ONE_SHOT, callback=lambda t:print(1))
90+ tim.init(period=2000, mode=Timer.PERIODIC, callback=lambda t:print(2))
91+
92+ The period is in milliseconds.
9193
9294Pins and GPIO
9395-------------
@@ -178,7 +180,7 @@ The I2C driver is implemented in software and works on all pins::
178180 from machine import Pin, I2C
179181
180182 # construct an I2C bus
181- i2c = I2C(frequency=100000, scl=Pin(5), sda=Pin(4))
183+ i2c = I2C(scl=Pin(5), sda=Pin(4), freq=100000 )
182184
183185 i2c.writeto(0x3a, '12') # write '12' to slave device with address 0x3a
184186
You can’t perform that action at this time.
0 commit comments