qmsk / e2

E2 Client, Tally output
Mozilla Public License 2.0
26 stars 7 forks source link

Invert GPIO #15

Open videojedi opened 7 years ago

videojedi commented 7 years ago

Hi, Firstly, great implementation. Thank you very much! Using it on a show as we speak. Just one request, would it be possible to have an option to invert the GPIO? I have used a standard off the shelf(amazon) relay unit that interfaces with the Pi really well, observing the 3.3v requirements of the Pi. But the relay unit is Active-low and so whilst I can connect the tallies to the normally closed terminals, it means the unit will 'Fail On' if the power is interrupted and all camera tallies come on. (I have found it best not to confuse cameraman!)

Thanks again,

Richard.

SpComb commented 7 years ago

You can also try using Linux's gpio-invert feature directly, outside of qmsk-e2.

echo 1 > /sys/class/gpio/gpioX/active_low
videojedi commented 7 years ago

Thanks. I'll give it a try.

videojedi commented 7 years ago

I added the following to the end of /opt/qmsk-e2/bin/gpio-export.sh

for gpio in "$@"; do echo 1 > /sys/class/gpio/gpio$gpio/active_low done

..... and now my outputs are inverted. (no more confused cameramen!)

Many thanks,

Richard.