-
-
Save anonymous/5bec3959917bc9369f3f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Design a circuit and write a test program, using the Arduino Nano, | |
that will test two input Transistor-Transistor Logic (TTL) gates | |
including AND, OR, NAND, NOR and XOR. | |
*/ | |
//initialize variable | |
int x=0; | |
int output = digitalRead(2); | |
int output2 = digitalRead(3); | |
void setup(); | |
{ | |
pinMode (2, OUTPUT); | |
pinMode (3, OUTPUT); | |
pinMode (8, INPUT); | |
pinMode (9, INPUT); | |
pinMode (10, INPUT); | |
pinMode (11, INPUT); | |
} | |
{ | |
if((output == LOW) & (output2 == LOW)){ | |
digitalWrite(8) | |
} | |
x == int 1; | |
} | |
{ | |
if{ | |
digitalWrite(2, LOW); | |
digitalWrite(3, HIGH); | |
digitalWrite(8, HIGH); | |
} | |
x == (x + int 2); | |
} | |
{ | |
if{ | |
digitalWrite(2, HIGH); | |
digitalWrite(3, LOW); | |
digitalWrite(8, HIGH); | |
} | |
x == (x + int 4); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment