diff --git a/docs/library/machine.Timer.rst b/docs/library/machine.Timer.rst index 5d357ca079..8464c7b369 100644 --- a/docs/library/machine.Timer.rst +++ b/docs/library/machine.Timer.rst @@ -31,7 +31,7 @@ class Timer -- control internal timers tim = Timer(1, mode=Timer.PERIODIC) tim_a = tim.channel(Timer.A, freq=1000) - led = Pin('GPIO2', af=0, mode=Pin.OUT) + led = Pin('GPIO2', mode=Pin.OUT) def tick(timer): # we will receive the timer object when being called print(timer.time()) # show current timer's time value (is microseconds) diff --git a/docs/wipy/quickref.rst b/docs/wipy/quickref.rst index e473017e83..aa679542ea 100644 --- a/docs/wipy/quickref.rst +++ b/docs/wipy/quickref.rst @@ -30,7 +30,7 @@ See :ref:`machine.Pin `. :: from machine import Pin - # initialize GP2 in gpio mode (af=0) and make it an output + # initialize GP2 in gpio mode (alt=0) and make it an output p_out = Pin('GP2', mode=Pin.OUT) p_out.value(1) p_out.value(0) @@ -54,7 +54,7 @@ See :ref:`machine.Timer ` and :ref:`machine.Pin `. : tim_a.time() # get the value in microseconds tim_a.freq(1) # 1 Hz - p_out = Pin('GP2', af=0, mode=Pin.OUT) + p_out = Pin('GP2', mode=Pin.OUT) tim_a.irq(handler=lambda t: p_out.toggle()) PWM (pulse width modulation) @@ -66,7 +66,7 @@ See :ref:`machine.Pin ` and :ref:`machine.Timer `. : from machine import Pin # assign GP25 to alternate function 9 (PWM) - p_out = Pin('GP25', mode=Pin.AF, af=9) + p_out = Pin('GP25', mode=Pin.AF, alt=9) # timer 2 in PWM mode and width must be 16 buts tim = Timer(2, mode=Timer.PWM, width=16)