No ADC class in machine module

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
Turbinenreiter
Posts: 288
Joined: Sun May 04, 2014 8:54 am

No ADC class in machine module

Post by Turbinenreiter » Mon Feb 04, 2019 10:48 am

Why do the docs mention and ADC module, but my pyboard flashed from current master (98f790b) says there is none?

Code: Select all

MicroPython v1.10-46-g98f790b03-dirty on 2019-02-04; PYBv1.1 with STM32F405RG
>>> import machine
>>> machine.ADC()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'ADC'

User avatar
Roberthh
Posts: 1368
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: No ADC class in machine module

Post by Roberthh » Mon Feb 04, 2019 11:40 am

Since the new structure of the docs that is irritating. There is a note in the fineprint that not everything applies to every board. Before the change, there were clear sections in the docs for every board.
B.t.w.: for PyBoard, ADC is in the pyb module, whith it's own set of methods. So maybe a note at machine.ADC could help.

That irritation may slowly fade away, if the firmware of the new Pyboard follows the new module structure.

Turbinenreiter
Posts: 288
Joined: Sun May 04, 2014 8:54 am

Re: No ADC class in machine module

Post by Turbinenreiter » Mon Feb 04, 2019 12:27 pm

Wow, that stuff is still not done? Isn't the machine module around since at least 2 years?

Post Reply