Hi everyone! I have an on/off flicker effect on my 16 bit counter using 2 shift registers. The higher the counter goes the most significant bits are fading on and off at every single clock pulse (because they have to stay on for a very long time). Is there any way such that the left 8 bits could stay on and only the 8 bits on the right to get multiplexed?
Here's my function code:
void counter()
{
int i;
int p=0;
while(1)
{
for(i=0;i<255;i++)
{
digitalWrite(latchPin , LOW);
shiftOut(dataPin, clockPin, LSBFIRST, i);
shiftOut(dataPin, clockPin, LSBFIRST, p);
digitalWrite(latchPin , HIGH);
delay(displayDelay);
}
p=p+1;
if(p==256)
{
p=0;
}
}
}
Also is there any problem with the code? Maybe a more efficient one?