summaryrefslogtreecommitdiff
path: root/docs/wipy/quickref.rst
diff options
context:
space:
mode:
authordanicampora <daniel@wipy.io>2016-02-14 13:46:04 +0100
committerdanicampora <daniel@wipy.io>2016-02-21 21:53:16 +0100
commit73c9f85b4ca10bcf8a01942e3638aa8b4331957a (patch)
treefbfbdb064ec984c7ba568c8e4a8b492ec039adf6 /docs/wipy/quickref.rst
parent562bcffd3aa9e9e1226389e658c6d5d0ac007add (diff)
cc3200: Simplify the Timer API and correct the documents.
Make the PWM duty cycle configurable from 0.00 to 100.00 by accepting values from 0 to 10000. Add automatic Pin assignment when operating in PWM mode.
Diffstat (limited to 'docs/wipy/quickref.rst')
-rw-r--r--docs/wipy/quickref.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/wipy/quickref.rst b/docs/wipy/quickref.rst
index a30eec2aa..6c2cf0de7 100644
--- a/docs/wipy/quickref.rst
+++ b/docs/wipy/quickref.rst
@@ -49,10 +49,10 @@ See :ref:`machine.Timer <machine.Timer>` and :ref:`machine.Pin <machine.Pin>`. :
from machine import Timer
from machine import Pin
- tim = Timer(1, mode=Timer.PERIODIC)
+ tim = Timer(0, mode=Timer.PERIODIC)
tim_a = tim.channel(Timer.A, freq=1000)
tim_a.time() # get the value in microseconds
- tim_a.freq(1) # 1 Hz
+ tim_a.freq(5) # 5 Hz
p_out = Pin('GP2', mode=Pin.OUT)
tim_a.irq(handler=lambda t: p_out.toggle())