Hi,
I was able to understand bit of 74595 and was able to code it using examples from the internet and now onto multiplexing 8 seven segment displays, and now bit perplexed in coding it, if the circuit is in the way which I have shown you, how would I be able to code for displaying two different number since it is connected together
//Pin connected to ST_CP of 74HC595
int latchPin = 8;
//Pin connected to SH_CP of 74HC595
int clockPin = 12;
////Pin connected to DS of 74HC595
int dataPin = 11;
void setup() {
//set pins to output so you can control the shift register
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}
void loop() {
// count from 0 to 255 and display the number
// on the LEDs
// for (int numberToDisplay = 0; numberToDisplay < 256; numberToDisplay++) {
// take the latchPin low so
// the LEDs don't change while you're sending in bits:
zero();
delay(20);
one();
delay(20);
//delay(500);
// }
}
void zero()
{
digitalWrite(latchPin, LOW);
// shift out the bits:
shiftOut(dataPin, clockPin, MSBFIRST, 0b11111111);// second 74595 register//among eight binary values lsb is Q0 which is 15th pin of 74595
//delay(1000);
shiftOut(dataPin, clockPin, MSBFIRST, 0b11111101); // first 74595 register, last bit is dp, last but two is middle line
//take the latch pin high so the LEDs will light up:
digitalWrite(latchPin, HIGH);
}
void one()
{
digitalWrite(latchPin, LOW);
// shift out the bits:
shiftOut(dataPin, clockPin, MSBFIRST, 0b11111111);// second 74595 register//among eight binary values lsb is Q0 which is 15th pin of 74595
//delay(1000);
shiftOut(dataPin, clockPin, MSBFIRST, 0b01100000); // first 74595 register, last bit is dp, last but two is middle line
//take the latch pin high so the LEDs will light up:
digitalWrite(latchPin, HIGH);
}
Now I need to have the code to display two different numbers, I have attached the circuit diagram
