Please take a look at my code I'm having a compiler issue and could use the help
int LED_P = 13;
int LED_R = 12;
int LED_N = 11;
int LED_D = 10;
int LED_L = 9;
int LED_OT = 8;
int S = 0;
int A = 1;
int B = 2;
int C = 3;
int P = 4;
int PN = 5;
float S_Read;
float A_Read;
float B_Read;
float C_Read;
float P_Read;
float PN_Read;
float S_Voltage;
float A_Voltage;
float B_Voltage;
float C_Voltage;
float P_Voltage;
float PN_Voltage;
float Low_Logic_Low;
float Low_Logic_High;
float High_Logic_Low;
float High_Logic_High;
float Low_PNLogic_Low;
float Low_PNLogic_High;
float High_PNLogic_Low;
float High_PNLogic_High;
// the setup routine runs once when you press reset:
void setup()
{
// initialize the digital pins as outputs
pinMode(LED_P, OUTPUT);
pinMode(LED_R, OUTPUT);
pinMode(LED_N, OUTPUT);
pinMode(LED_D, OUTPUT);
pinMode(LED_L, OUTPUT);
pinMode(LED_OT, OUTPUT);
// initialize the analog pins as inputs
pinMode(S, INPUT);
pinMode(A, INPUT);
pinMode(B, INPUT);
pinMode(C, INPUT);
pinMode(P, INPUT);
pinMode(PN, INPUT);
}
// the loop routine runs over and over again forever:
void loop() {
// Read analog channels
S_Read = analogRead(S);
delay(10);
A_Read = analogRead(A);
delay(10);
B_Read = analogRead(B);
delay(10);
C_Read = analogRead(C);
delay(10);
P_Read = analogRead(P);
delay(10);
PN_Read = analogRead(PN);
// Convert analog reading to voltage
S_Voltage = S_Read/10245;
A_Voltage = A_Read/10245;
B_Voltage = B_Read/10245;
C_Voltage = C_Read/10245;
P_Voltage = P_Read/10245;
PN_Voltage = PN_Read/10245;
// Set Logic High and Logic Low Limits
Low_Logic_Low = 0;
Low_Logic_High = 1;
High_Logic_Low = 4;
High_Logic_High = 5;
// Set Logic for Park LED:
if( (S_Voltage > High_Logic_Low) && (S_Voltage < High_Logic_High) &&
(A_Voltage > High_Logic_Low) && (A_Voltage < High_Logic_High) &&
(B_Voltage < Low_Logic_High) &&
(C_Voltage < Low_Logic_High) &&
(P_Voltage > High_Logic_Low) && (P_Voltage < High_Logic_High)
)
// Turn Park LED ON
{
digitalWrite(LED_P, HIGH);
}
// Turn Park LED OFF
else
{
digitalWrite(LED_P, LOW);
}
// Set logic for Reverse LED:
if( (S_Voltage > Low_Logic_Low) &&
(A_Voltage > High_Logic_Low) && (A_Voltage < Low_Logic_High) &&
(B_Voltage > High_Logic_Low) && (B_Voltage < High_Logic_High) &&
(C_Voltage > Low_Logic_Low) &&
(P_Voltage > Low_Logic_Low)
)
// Turn Reverse LED ON
{
digitalWrite(LED_R, HIGH);
}
// Turn Reverse LED OFF
else
{
digitalWrite(LED_R, LOW);
}
// Set logic for Neutral LED:
if( (S_Voltage > Low_Logic_High) && (S_Voltage < High_Logic_High) &&
(A_Voltage > Low_Logic_Low) &&
(B_Voltage > Low_Logic_High) && (B_Voltage < High_Logic_High) &&
(C_Voltage > Low_Logic_Low) &&
(P_Voltage > Low_Logic_High) && (P_Voltage < High_Logic_High)
)
// Turn Neutral LED ON
{
digitalWrite(LED_N, HIGH);
}
// Turn Neutral LED OFF
else
{
digitalWrite(LED_N, LOW);
}
// Set logic for Drive LED:
if( (S_Voltage > Low_Logic_Low) &&
(A_Voltage > Low_Logic_Low) &&
(B_Voltage > Low_Logic_High) && (B_Voltage < High_Logic_High) &&
(C_Voltage > Low_Logic_High) && (C_Voltage < High_Logic_High) &&
(P_Voltage > Low_Logic_Low)
)
// Turn Drive LED ON
{
digitalWrite(LED_D, HIGH);
}
// Turn Drive LED OFF
else
{
digitalWrite(LED_D, LOW);
}
// Set logic for L LED:
if( (S_Voltage > Low_Logic_Low) &&
(A_Voltage > Low_Logic_High) && (A_Voltage < High_Logic_High) &&
(B_Voltage > Low_Logic_Low) && (B_Voltage < Low_Logic_High) &&
(C_Voltage > Low_Logic_Low) && (C_Voltage < Low_Logic_High) &&
(P_Voltage > High_Logic_Low) && (P_Voltage < High_Logic_High)
)
// Turn L LED ON
{
digitalWrite(LED_L, HIGH);
}
// Turn L LED OFF
else
{
digitalWrite(LED_L, LOW);
}
// Set logic for OT LED:
if( (S_Voltage > Low_Logic_Low) &&
(A_Voltage > Low_Logic_High) && (A_Voltage < High_Logic_High) &&
(B_Voltage > Low_Logic_Low) &&
(C_Voltage > Low_Logic_Low) &&
(P_Voltage > Low_Logic_High) && (P_Voltage < High_Logic_High)
)
}
}
}