micropython R1.9 ETA @@ released @@
Re: micropython R1.9 ETA @@ released @@
Reading PR3025 was enlightening...
Re: micropython R1.9 ETA @@ released @@
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.
Maintaining 2 sets of code, one for devices already deployed (< 1.9) and another for new ones is going to be a major headache.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
SPI and Pin methods
@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?
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.
Index to my micropython libraries.
Re: micropython R1.9 ETA @@ released @@
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()
>>>
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Confirmed on ESP8266
OK, confirmed on ESP8266. So the behaviour of platforms differs. I'll raise an issue.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: micropython R1.9 ETA @@ released @@
.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?
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.So the behaviour of platforms differs.
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/
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/
Re: micropython R1.9 ETA @@ released @@
http://docs.micropython.org/en/latest/p ... s-and-gpio
http://docs.micropython.org/en/latest/e ... s-and-gpio
I use them, because the docs tell me to.
http://docs.micropython.org/en/latest/e ... s-and-gpio
I use them, because the docs tell me to.
Re: micropython R1.9 ETA @@ released @@
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...
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...
Re: micropython R1.9 ETA @@ released @@
The second link talks about the machine module.