Minor mistake in Documantation? - class Pin

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
Hanilein
Posts: 29
Joined: Thu Jul 12, 2018 11:40 am
Location: Christchurch, New Zealand

Minor mistake in Documantation? - class Pin

Post by Hanilein » Thu Oct 18, 2018 8:37 am

The documentation for the class Pin says:
CPU pins which correspond to the board pins are available as pyb.cpu.Name.
For the CPU pins, the names are the port letter followed by the pin number.
On the PYBv1.0, pyb.Pin.board.X1 and pyb.Pin.cpu.A0 are the same pin.
The example is correct, but in the first sentence pyb.cpu.Name must be pyb.Pin.cpu.Name

Otherwise you get an AttributeError: 'module' object has no attribute 'cpu'

Link: http://docs.micropython.org/en/latest/l ... .Pin.html

At first I was not looking at the example, of course - DOH
Ivo Gorny


Post Reply