//Definitions int Q0_0=12; //Read pins int Q0_1=11; //Q0 is least significant chip int Q0_2=10; //Q1 is most significant chip int Q0_3=9; int Q1_0=8; int Q1_1=7; int Q1_2=6; int Q1_3=5; int rb0=0; //Read bits int rb1=0; int rb2=0; int rb3=0; int rb4=0; int rb5=0; int rb6=0; int rb7=0; int clock=13; //Clock pin is LED pin int count=0; void setup() { Serial.begin(9600); pinMode(13, OUTPUT); pinMode(12, INPUT); pinMode(11, INPUT); pinMode(10, INPUT); pinMode(9, INPUT); pinMode(8, INPUT); pinMode(7, INPUT); pinMode(6, INPUT); pinMode(5, INPUT); } void loop() { rb0=digitalRead(Q0_0); //Reads the counters' bits rb1=digitalRead(Q0_1); rb2=digitalRead(Q0_2); rb3=digitalRead(Q0_3); rb4=digitalRead(Q1_0); rb5=digitalRead(Q1_1); rb6=digitalRead(Q1_2); rb7=digitalRead(Q1_3); count= rb0 + 2*rb1 + 4*rb2 + 8*rb3 //Converts the bits to decimal + 16*rb4 + 32*rb5 + 64*rb6 + 128*rb7; Serial.println(count); //Prints count to serial monitor digitalWrite(clock,HIGH); //Clock pulse advances count by one delay(3); digitalWrite(clock,LOW); delay(500); //Slows the Arduino }