pi pico uart interrupt

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
ronan
Posts: 1
Joined: Tue Jan 25, 2022 10:18 pm

pi pico uart interrupt

Post by ronan » Tue Jan 25, 2022 10:25 pm

Hello, I need help programming a rasberrypi pico in micropython:
I want to receive data via uart from a bluetooth module, in my program I would have to use uart by interrupt because part of the program runs continuously and as soon as we receive something via the uart it would have to change some variables that count in the program that runs continuously, how to do?
(I don't know if this is understandable)

kreasteve
Posts: 7
Joined: Tue Jan 25, 2022 7:48 am
Location: Germany

Re: pi pico uart interrupt

Post by kreasteve » Wed Jan 26, 2022 11:53 am

Hi ronan,

you can use UART.irq https://docs.micropython.org/en/latest/ ... e.UART.irq
to start a function every time a uart packet is comming in.

You could also take the second core to handle the uart and send back values to the main loop (first core).

Post Reply