micropython R1.9 ETA @@ released @@

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.

User avatar
mattyt
Posts: 410
Joined: Mon Jan 23, 2017 6:39 am

Re: micropython R1.9 ETA @@ released @@

Post by mattyt » Mon May 29, 2017 9:26 am

Reading PR3025 was enlightening...

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: micropython R1.9 ETA @@ released @@

Post by devnull » Mon May 29, 2017 9:41 am

I am only stating the obvious here, but doesn't this break every bit of code not included in the official 1.9 release files that does any form of digital I/O ?

Maintaining 2 sets of code, one for devices already deployed (< 1.9) and another for new ones is going to be a major headache.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

SPI and Pin methods

Post by pythoncoder » Mon May 29, 2017 10:01 am

@deshipu I had seen those changes. I was looking for changes relating to SPI as I thought you were reporting a problem with that. But I get it now - changes to Pin have the potential to affect drivers using SPI.

Re Pin as I understand it the Pin high and low methods are deprecated, not unsupported. This is confirmed with the obvious tests below. I've tried a range of my own applications and I've yet to find one that fails under today's build.

Can anyone post actual code which runs under old builds and fails under 1.9?

Code: Select all

>>> from machine import Pin
>>> p = Pin('X1', Pin.OUT)
>>> p.low()
>>> p()
0
>>> p.high()
>>> p()
1
>>> p.low()
>>> p()
0
>>> 
Peter Hinch
Index to my micropython libraries.

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: micropython R1.9 ETA @@ released @@

Post by devnull » Mon May 29, 2017 10:22 am

Fails for me on version 1.9 - 8266 ??

Code: Select all

>>> from machine import Pin
>>> p = Pin(5, Pin.OUT)
>>> p.low()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Pin' object has no attribute 'low'
>>> p.on()
>>> p.off()
>>> 


User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Confirmed on ESP8266

Post by pythoncoder » Mon May 29, 2017 3:03 pm

OK, confirmed on ESP8266. So the behaviour of platforms differs. I'll raise an issue.
Peter Hinch
Index to my micropython libraries.

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: micropython R1.9 ETA @@ released @@

Post by pfalcon » Mon May 29, 2017 4:07 pm

.high() and .low() methods were never part of the MicroPython hardware API nor were documented. So, why were you using undocumented methods and why are you now surprised they don't work?
So the behaviour of platforms differs.
No, the behavior of the platforms is consistent: there're only .on()/.off()/.value() methods, both for Pin and Signal. If .on/.off doesn't work for you, no problem, use .value(). Want something else - no problem, it's Python, so everything is easy. Subclass Pin or wrap it and add whatever you want. Of course, that will cost you memory. When you add too much stuff that you will run out of it and will have to remove useless boilerplate methods to make your app do something useful, you'll exactly understand the course of action which led MicroPython in the same direction over last 1.5 or so years, in public, very bikesheddy, if not say it worse, discussions.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/


User avatar
marfis
Posts: 215
Joined: Fri Oct 31, 2014 10:29 am
Location: Zurich / Switzerland

Re: micropython R1.9 ETA @@ released @@

Post by marfis » Mon May 29, 2017 8:20 pm

I guess he meant it was never part of the machine module (pyb still supports high/low)

To me, high/low refers to an electrical state, and that is what a pin's state is. It is somewhat confusing that on/off is now used for both signal and pins... but maybe it's just me...

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: micropython R1.9 ETA @@ released @@

Post by deshipu » Mon May 29, 2017 10:05 pm

The second link talks about the machine module.

Post Reply