int timer = 500; // The higher the number, the slower the timing. int ledPins[] = { 0,1,2,3, 4, 5 }; // an array of pin numbers to which LEDs are attached int pinCount = 6; // the number of pins (i.e. the length of the array) bool A,B; void setup() { // the array elements are numbered from 0 to (pinCount - 1). // use a for loop to initialize each pin as an output: for (int thisPin = 0; thisPin < pinCount; thisPin++) { pinMode(ledPins[thisPin], OUTPUT); // input for truth tables pinMode(6, INPUT); pinMode(7, INPUT); //initialize all led as OFF digitalWrite(ledPins[thisPin], LOW); } /* initialize serial port (USB) as UART 9600 8-N-1 to view Input/output on a terminal */ Serial.begin(9600); } void truthled(void) { A=digitalRead(6); B=digitalRead(7); if(A&B){ Serial.println("AND = 1"); digitalWrite(ledPins[3], HIGH); } else{ digitalWrite(ledPins[3], LOW); Serial.println("AND = 0"); } if(A|B){ Serial.println("OR = 1"); digitalWrite(ledPins[4], HIGH); } else{ digitalWrite(ledPins[4], LOW); Serial.println("OR = 0"); } if(A^B){ digitalWrite(ledPins[5], HIGH); } else digitalWrite(ledPins[5], LOW); } void loop() { int current, previous; // put your main code here, to run repeatedly: // Shift led previous=3; current=0; /* //blink for(current=0; current