Hi all
I use bash for my hardware projects because it is the only "language" i know.
To query a switch for example i use something like this:I know it is ugly but it works.
I ask me if there is a better way by using "pinctrl poll" option?
Something like:Does anyone have any ideas on how this could be implemented?
Does it even make sense to change this (for example to save resources?).
Many thanks and greetings.
I use bash for my hardware projects because it is the only "language" i know.
To query a switch for example i use something like this:
Code:
while true; doif [ "$(pinctrl lev ${SWITCHPIN})" = "0" ]; then echo "switch pressed!"fisleep 0.1done

I ask me if there is a better way by using "pinctrl poll" option?
Something like:
Code:
while [ "$(pinctrl poll ${SWITCHPIN})" = "?" ]; do echo "switch pressed!"done
Does it even make sense to change this (for example to save resources?).
Many thanks and greetings.
Statistics: Posted by The_Raven — Fri Dec 13, 2024 1:45 pm — Replies 0 — Views 16