Skip to content

Instantly share code, notes, and snippets.

Created December 6, 2013 00:56
Show Gist options
  • Save anonymous/5bec3959917bc9369f3f to your computer and use it in GitHub Desktop.
Save anonymous/5bec3959917bc9369f3f to your computer and use it in GitHub Desktop.
/*
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