2

When using conditional filters in config.txt, is it possible to use boolean logic for specific GPIO combinations?

I tried the following and it did not work:

[gpio24=0,gpio25=0,gpio26=0,gpio27=0]
do_this_thing=1
[all]

[gpio24=0 & gpio25=0 & gpio26=0 & gpio27=0]
do_this_thing=1
[all]

[gpio24=0 && gpio25=0 && gpio26=0 && gpio27=0]
do_this_thing=1
[all]

[gpio24=0][gpio25=0][gpio26=0][gpio27=0]
do_this_thing=1
[all]

Raspberry Pi config.txt conditional filters: https://www.raspberrypi.org/documentation/configuration/config-txt/conditional.md

3
  • You really need to address this question to the authors of the software. As a general point if a feature is not mentioned in the documentation you shouldn't use it. Even if it happens to work it might be removed without notice.
    – joan
    Sep 9 '19 at 20:19
  • The Raspberry Pi Foundation engineers have noted in the past that the documentation may not always be up to date or the best and that better answers are on the forums. I have posted this question on their forums as well and if I get a response I'll update this posting.
    – Roy
    Sep 9 '19 at 20:32
  • You could always try the method in the documentation i.e. each condition on a seperate line.
    – Milliways
    Sep 10 '19 at 0:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.