Page 2 of 2

Re: Documentation for ESP32 Port

Posted: Thu Dec 20, 2018 8:44 am
by mattyt
For the record, as discussed in ESP32 Documentation, an effort has begun to pull together documentation for the ESP32. Any help would be appreciated!

@jickster documentation is a high priority, for me at least! :)

The reason I (personally) haven't yet merged much of Boris' good work back into mainline is because it takes a fair amount of effort. Boris has the benefit that a) he's the only developer so can create as he wishes and b) only needs to support ESP32. This allows him to move quickly and, great for us!, provide features rapidly. However, mainline MicroPython needs peer review and is concerned with developing features that can be compatible with other ports. I've found that few of his features are a simple merge upstream...

Re: Documentation for ESP32 Port

Posted: Thu Dec 20, 2018 9:44 am
by wr300000
Thank, mattyt...I can move on now..
thank again,

Re: Documentation for ESP32 Port

Posted: Thu Dec 20, 2018 11:58 am
by OutoftheBOTS_
mattyt wrote:
Thu Dec 20, 2018 8:28 am
wr300000 wrote:
Thu Dec 20, 2018 7:54 am
>>> import machine
>>> a=machine.ADC(35)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: expecting a pin
I know that sometimes the error messages aren't fantastic but, in this case it's spot-on:

Code: Select all

MicroPython v1.9.4-725-gd690c2e14 on 2018-12-09; ESP32 module with ESP32
Type "help()" for more information.
>>>
>>> import machine
>>> a = machine.ADC(35)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: expecting a pin
>>> a = machine.ADC(machine.Pin(35))
>>> a.read()
14
Now, whether ADC should also accept an int to infer a Pin is open for debate - but at least that should get you going.
@mattyt on the note that you have asked before about what's different in different ports, this is something that does differ from port to port. Since your the man that has dive in deep with trying to fix some of the inconstant syntax you can add this 1 to the list. It might be good if MP started to set down some offical syntax for Machine Module so when other ports r developed there is something to follow. I do prefer if both were accepted.

Re: Documentation for ESP32 Port

Posted: Wed Dec 26, 2018 3:09 pm
by mattyt
I agree that it should be consistent @OutoftheBOTS_ and have raised #4379 to cover the issue.

I'll add it to my list... ;)