Skip to content

Commit 4b6077b

Browse files
committed
docs/esp8266: Minor tweaks to quickref, Timer and I2C classes.
1 parent 43d4975 commit 4b6077b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/esp8266/quickref.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff 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

9294
Pins 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

0 commit comments

Comments
 (0)