micropython / micropython-esp32

Old port of MicroPython to the ESP32 -- new port is at https://github.com/micropython/micropython
MIT License
669 stars 216 forks source link

Make UART allow Pin #266

Open MATTYGILO opened 1 year ago

MATTYGILO commented 1 year ago

It would be great if UART accepted Pin class instead of integers

>>> UART(1, 9600, timeout=1000, rx=Pin(18), tx=Pin(17))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: can't convert Pin to int
BEMNETADEFIS commented 1 year ago

The micropython reads and also combines concept from C programming 2 python allocation of memory and registers in C using hexadecimal combined with variables R known stratgy for hardware programming so if u can use this techniques for programming ur module with less lines of conjugation of line of array so that u can locate UART registers for managing UART port Also python hv options for this i think

On Fri, Nov 18, 2022, 4:04 PM MATTYGILO @.***> wrote:

It would be great if UART accepted Pin class instead of integers

UART(1, 9600, timeout=1000, rx=Pin(18), tx=Pin(17)) Traceback (most recent call last): File "", line 1, in TypeError: can't convert Pin to int

— Reply to this email directly, view it on GitHub https://github.com/micropython/micropython-esp32/issues/266, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZTRFYHUYYXQYU5UNL72MTWI55GDANCNFSM6AAAAAASEPCHXA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

nickzoic commented 1 year ago

I kind of agree with you there @MATTYGILO but please note this repository is no longer active, the ESP32 port has been merged into the main Micropython repo at https://github.com/micropython/micropython