Beja Expert Licensed User Longtime User Apr 21, 2019 #1 Hi all I am developing a b4r project that's similar but not really, a machine that will operate using two switches .. Say pin7 is switch1 and pin8 is switch2 Pin9 is the output to the machine. The two input pins represent the two NAND gate inputs. You know the truth table for NAND gate but I don't know how to translate it to b4r code. Any help appreciated.
Hi all I am developing a b4r project that's similar but not really, a machine that will operate using two switches .. Say pin7 is switch1 and pin8 is switch2 Pin9 is the output to the machine. The two input pins represent the two NAND gate inputs. You know the truth table for NAND gate but I don't know how to translate it to b4r code. Any help appreciated.
derez Expert Licensed User Longtime User Apr 22, 2019 #2 Code: Copy If pin7.DigitalRead And pin8.DigitalRead Then pin9.DigitalWrite(False) Else pin9.DigitalWrite(True) End If Upvote 0
Code: Copy If pin7.DigitalRead And pin8.DigitalRead Then pin9.DigitalWrite(False) Else pin9.DigitalWrite(True) End If