Thank you, I was unable to follow your code, but wrote something that got it working, at least the first step.
const int digits = 4;
const int latchPin = 7;
const int clockPin = 6;
const int dataPin = 5;
const int digitOne = 8;
const int digitTwo = 9;
const int digitThree = 10;
const int digitFour = 11;
const byte digit[10] =
{
B10000001, //0 ----------
B11110011, //1 ----------
B01001001, //2 ----------
B01100001, //3 ----------
B00110011, //4 ----------
B00100101, //5 ----------
B00000101, //6 ----------
B11110001, //7 ----------
B00000001, //8 ----------
B00100001, //9 ----------
};
void setup() {
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(digitOne, OUTPUT);
pinMode(digitTwo, OUTPUT);
pinMode(digitThree, OUTPUT);
pinMode(digitFour, OUTPUT);
digitalWrite(digitOne, HIGH);
digitalWrite(digitTwo, HIGH);
digitalWrite(digitThree, HIGH);
digitalWrite(digitFour, HIGH);
}
void update_display() {
for (int i = 0; i < 10; i++)
{
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, digit[i]);
delay(200);
digitalWrite(latchPin, HIGH);
}
}
void loop ()
{
update_display();
delay(200);
}
Now I need to realize how to write over some specific digit and not the four at the same time