Page 1 of 1

pi pico uart interrupt

Posted: Tue Jan 25, 2022 10:25 pm
by ronan
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)

Re: pi pico uart interrupt

Posted: Wed Jan 26, 2022 11:53 am
by kreasteve
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).