I know this is simple but I'd like to replace the delay(1000); with the millis; code with minimal modification to the rest of the code but nothing I've tried works. This Code just drives a 7 Segment display that start's at 0 and counts up to 9 and then infinitely repeats the 0 - 9 Count.
const int NumLEDs = 8;
const int LEDPins[NumLEDs] = {6,7,8,9,10,11,12,13};
byte SegCount = 0;
byte Digit = 0;
byte Pin = 0;
int LoopTime = 0;
int LoopTimeB = 0;
unsigned long CurrentTime = 0;
byte SevenSegDigits[10][7] =
{
{ 1,1,1,1,1,1,0 }, // = 0
{ 0,1,1,0,0,0,0 }, // = 1
{ 1,1,0,1,1,0,1 }, // = 2
{ 1,1,1,1,0,0,1 }, // = 3
{ 0,1,1,0,0,1,1 }, // = 4
{ 1,0,1,1,0,1,1 }, // = 5
{ 1,0,1,1,1,1,1 }, // = 6
{ 1,1,1,0,0,0,0 }, // = 7
{ 1,1,1,1,1,1,1 }, // = 8
{ 1,1,1,1,0,1,1 } // = 9
};
void setup()
{
for(int i = 0; i < NumLEDs; i++)
{
pinMode(LEDPins[i], OUTPUT);
digitalWrite(LEDPins[i], LOW);
}
}
void loop()
{
CurrentTime = millis();
for (Digit = 0; Digit < 10; ++Digit) //Select Seven Segment Digit to Display (0 - 9) from Array
{
Pin = 6; //Select Segment A Pin
for (SegCount = 0; SegCount < 7; ++SegCount) //Count through Segemnts A - G
{
digitalWrite(Pin, SevenSegDigits[Digit][SegCount]); //Turn the Pin HIGH or LOW based on [Digit][SegCount] position in the Array
++Pin; //Increment the Pin
}
delay(1000); //Delay 1 Second
}
Please show me why I'm so stupid and Thanks in advance