How to read GPIO in real time?
- chen1234
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 58
- Thank you received: 2
16 Aug 2022 10:13 #249873
by chen1234
How to read GPIO in real time? was created by chen1234
Guys, I'm using a raspberry pi as a controller,
and this controller needs to read a lot of GPIO (not including home and limits).
I'm trying to poll read GPIO using threads in my custom Glade UI.
But I found that this read is not timely and will be a little later than my signal.
How should I get these GPIOs, so that this IO can be read interrupted?
(I'm a newbie and don't know much about the underlying stuff)
Hope you can give me some advice?
thanks,chen
and this controller needs to read a lot of GPIO (not including home and limits).
I'm trying to poll read GPIO using threads in my custom Glade UI.
But I found that this read is not timely and will be a little later than my signal.
How should I get these GPIOs, so that this IO can be read interrupted?
(I'm a newbie and don't know much about the underlying stuff)
Hope you can give me some advice?
thanks,chen
Please Log in or Create an account to join the conversation.
- elovalvo
- Offline
- Elite Member
Less
More
- Posts: 202
- Thank you received: 125
16 Aug 2022 13:50 #249889
by elovalvo
Replied by elovalvo on topic How to read GPIO in real time?
I think the best solution is to use the hal_pi_gpio module:
forum.linuxcnc.org/27-driver-boards/3770...r-raspberry-pi-gpios
forum.linuxcnc.org/27-driver-boards/3770...r-raspberry-pi-gpios
The following user(s) said Thank You: chen1234
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23170
- Thank you received: 4860
26 Aug 2022 14:15 #250512
by andypugh
Replied by andypugh on topic How to read GPIO in real time?
Your GUI will never be able to respond to GPIO inputs in real=time as the GUIs are not realtime.
You should leave home and limits to be handled by the normal realtime motion module.
You should leave home and limits to be handled by the normal realtime motion module.
The following user(s) said Thank You: chen1234
Please Log in or Create an account to join the conversation.
Time to create page: 0.054 seconds