Hi, I just joined this forum.
I am experimenting with a RPi Pico.
Using Thonny IDE v 3.3.3 in MS Windows 10.
The Pico has Micropython v1.15 of 2021-04-18 installed.
I am working on a script that has to receive ansynchronus UDP messages (GPS flightsim data).
It actually is a port from a same project I did successfully in the past with a RPi Pi and later with an Arduino MEGA 2560.
In Thonny, when using the REPL mode, after entering "from machine import UART", then: dir(UART) among other things there was listed: 'any'.
According to https://docs.micropython.org/en/latest/ ... uart%20any the function any() has to be called without parameter(s), however the call 'UART.any()' in Thonny's REPL returned:
>>> UART.any()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: function takes 1 positional arguments but 0 were given
After seeing this error i tried: 'UART.any(0)' and 'UART.any('0')'. Both commands resulted in errors too.
Anyone has an idea what can cause this?
Greetings,
paulsk
UART.any() needs an argument says Thonny REPL
Re: UART.any() needs an argument says Thonny REPL
You have to call uart.any() on the UART instance you have created, not the class. So you would have something like:
from machine import UART
uart=UART(1)
uart.any()
from machine import UART
uart=UART(1)
uart.any()
Re: UART.any() needs an argument says Thonny REPL
That's it! Thank you