Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
4b6077b3
Commit
4b6077b3
authored
Mar 9, 2016
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
docs/esp8266: Minor tweaks to quickref, Timer and I2C classes.
parent
43d49759
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/esp8266/quickref.rst
+5
-3
5 additions, 3 deletions
docs/esp8266/quickref.rst
with
5 additions
and
3 deletions
docs/esp8266/quickref.rst
+
5
−
3
View file @
4b6077b3
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment