Well you didn't read the sticky or your code would be in code tags. Yes, it's a big thing. A really big thing.
Thanks sir Nick. I was talking about the 5-hour thing and about my "UP" reply. noted.
If you have 4 switches, one option is to convert those 4 inputs into a number:
BCD_number = 0; // clear the variable to start
BCD_number = digitalRead(Din); // result is 0 or 1
BCD_number = BCD_Number <<1 + digitalRead(Cin); // shift over 1 bit, and add in next bit
BCD_number = BCD_Number <<1 + digitalRead(Bin); // shift over 1 bit, and add in next bit
BCD_number = BCD_Number <<1 + digitalRead(Ain); // shift over 1 bit, and add in next bit
Serial.println (BCD_Number, DEC); // check the result
// Now use your display mapping:
shiftout(dataPin, clockPin, MSBFIRST, numbers[BCD_number] ); // lookup the mapping in the array and send it to the shift register
Thank you so much sir! By the way, I just have to
add this:
BCD_number = BCD_Number <<1 + digitalRead(Din); // shift over 1 bit, and add in next bit
and then copy-paste all these lines to the loop function, right?
Also, is there anything else I need to modify in the codes to display two hex digits in two 7 segment display? How am I suppose to connect the second shift register to the first one?