trixo
Posts: 47
Joined: Fri Apr 26, 2019 6:12 pm

UART genrating a interrupt ?

Sun Dec 03, 2023 11:14 am

hello,

i'am busy to make a code for running a stepper motor (with driver with pulse & dir):
- one at a time
- acc & decc
- with limitswitch

the stepper is controlled by a touchscreen who is connected with UART to the raspberry pico.
to move the stepper, i push a "button" on the touchscreen ---> the stepper is moving.
when i release the "button" on the touchscreen ---> the stepper must deccelerate, and here i need i think a interrupt on de UART.
because when the stepper is moving, the program is in a for loop, and wil "not see" something is happening on the touchscreen.
thank you.

hippy
Posts: 15868
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: UART genrating a interrupt ?

Sun Dec 03, 2023 3:58 pm

trixo wrote:
Sun Dec 03, 2023 11:14 am
here i need i think a interrupt on de UART. because when the stepper is moving, the program is in a for loop, and wil "not see" something is happening on the touchscreen.
You could perhaps poll the UART, or a UART receive handler.

trixo
Posts: 47
Joined: Fri Apr 26, 2019 6:12 pm

Re: UART genrating a interrupt ?

Mon Dec 04, 2023 5:38 pm

i solved the problem,
in the for loop where i make the "pulse" for the stepper driver,
i read also the UART from the touchscreen that says "button released"
I hadn't realized this was even possible ;)

Return to “MicroPython”