summaryrefslogtreecommitdiffstatshomepage
path: root/docs/esp8266/quickref.rst
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-03-09 11:02:38 +0000
committerDamien George <damien.p.george@gmail.com>2016-03-09 11:02:38 +0000
commit4b6077b3febca751eeace038b69074f262f1b221 (patch)
tree9c8cba8807da730842eb1a438a67a205cf4aea0a /docs/esp8266/quickref.rst
parent43d497592f26c4ede5aa7d559ac3ea5ba20db76a (diff)
downloadmicropython-4b6077b3febca751eeace038b69074f262f1b221.tar.gz
micropython-4b6077b3febca751eeace038b69074f262f1b221.zip
docs/esp8266: Minor tweaks to quickref, Timer and I2C classes.
Diffstat (limited to 'docs/esp8266/quickref.rst')
-rw-r--r--docs/esp8266/quickref.rst8
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/esp8266/quickref.rst b/docs/esp8266/quickref.rst
index 40b8c52e51..1056122977 100644
--- a/docs/esp8266/quickref.rst
+++ b/docs/esp8266/quickref.rst
@@ -86,8 +86,10 @@ Use the ``machine.Timer`` class::
from machine import Timer
tim = Timer(0)
- tim.init(period=10, mode=Timer.ONE_SHOT, callback=lambda t:print(1))
- tim.init(period=1, mode=Timer.PERIODIC, callback=lambda t:print(2))
+ tim.init(period=5000, mode=Timer.ONE_SHOT, callback=lambda t:print(1))
+ tim.init(period=2000, mode=Timer.PERIODIC, callback=lambda t:print(2))
+
+The period is in milliseconds.
Pins and GPIO
-------------
@@ -178,7 +180,7 @@ The I2C driver is implemented in software and works on all pins::
from machine import Pin, I2C
# construct an I2C bus
- i2c = I2C(frequency=100000, scl=Pin(5), sda=Pin(4))
+ i2c = I2C(scl=Pin(5), sda=Pin(4), freq=100000)
i2c.writeto(0x3a, '12') # write '12' to slave device with address 0x3a