Skip to content

m0: error messages refer to confusing pin names #83

@deshipu

Description

@deshipu

I just tried the latest release of the CircuitPython for the Feather M0 Basic, and I noticed a problem with some of the error messages. I tried to replicate the LED fading in and out, so I did this:

>>> p = nativeio.AnalogOut(board.D13)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: AnalogOut only supported on pin PA02.

However, I can't seem to be able to find the pin PA02 anywhere. The board module only contains this:

>>> board.
A0              A1              A2              A3
A4              A5              SCK             MOSI
MISO            D0              RX              D1
TX              SDA             SCL             D5
D6              D9              D10             D11

I tried to pass the pin name as a string, but that results in this:

>>> p = nativeio.AnalogOut('PA02')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Expected a Pin

Finally, I went to the reference documentation at http://circuitpython.readthedocs.io/en/latest/shared-bindings/nativeio/AnalogOut.html and discovered, that I'm not supposed to be using the pins from the board module, but instead import pin from microcontroller and use those. Fine, I wonder what the board module is for then...

Anyways, I searched the documentation further to try and find out which physical pin on the board the microcontroller.pin.PA02 refers to, but I wasn't able to find it. I know that I can just go to the Feather M0 product page and look at the datasheet for the microcontroller and compare it with the schematic to learn that, but I think this is a bit more of an effort than an everage user can do.

Would it make more sense to either put that reference somewhere in the documentation, or use the pin constants defined in the board module?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions