Alright, here we go:
int recNum = 0;
int One[2] = {12, 11};
int Two[5] = {13, 12, 10, 9, 7};
int Three[5] = {13, 12, 11, 10, 7};
int Four[4] = {12, 11, 8, 7};
int Five[5] = {13, 11, 10, 8, 7};
int Six[6] = {13, 11, 10, 9, 8, 7};
int Seven[3] = {13, 12, 11};
int Eight[7] = {13, 12, 11, 10, 9, 8, 7};
int Nine[6] = {13, 12, 11, 10, 8, 7};
int Zero[6] = {13, 12, 11, 10, 9, 8};
/*
13 is Top
12 is Top-Right
11 is Bottom-Right
10 is Bottom
9 is Bottom-Left
8 is Top-Left
7 is Middle
6 is Decimal Point
*/
int x = 0;
//The given size of the current Array being read
int y = 0;
//The value of the current element being read
void setup()
{
Serial.begin(9600);
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);
pinMode(7, OUTPUT);
pinMode(6, OUTPUT);
}
void loop()
{
if(Serial.available() > 0)
{
recNum = Serial.read();
Number();
delay(1000);
Reset();
delay(1000);
}
}
int Number()
{
int loopCount = 0;
x = sizeof(recNum) / 2;
while(loopCount < x)
{
y = recNum[loopCount];
//Error is given in the line above
digitalWrite(y, HIGH);
loopCount = loopCount + 1;
}
}
int Reset()
{
digitalWrite(13, LOW);
digitalWrite(12, LOW);
digitalWrite(11, LOW);
digitalWrite(10, LOW);
digitalWrite(9, LOW);
digitalWrite(8, LOW);
digitalWrite(7, LOW);
digitalWrite(6, LOW);
}