B4R Question Help with NAND gate

Discussion in 'B4R Questions' started by Beja, Apr 21, 2019.

  1. Beja

    Beja Expert Licensed User

    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.
     
  2. derez

    derez Expert Licensed User

    Code:
    If pin7.DigitalRead And pin8.DigitalRead  Then
            pin9.DigitalWrite(
    False)
        
    Else
            pin9.DigitalWrite(
    True)
        
    End If
     
    tigrot and Beja like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice