Expected primary-expression before ','tken issue

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/1024
5;
B_Voltage = B_Read/10245;
C_Voltage = C_Read/1024
5;
P_Voltage = P_Read/10245;
PN_Voltage = PN_Read/1024
5;

// 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)

)

}
}
}

I'm having a compiler issue

The compiler told you exactly which line it didn't like (though the real problem might be the line before it). Since you did NOT post your code correctly, it is too difficult to copy it into the IDE to compile, to find the line number. And I'm not wasting any more time looking.

Read the stickies at the top of the forum. Post your code correctly. Post the EXACT error message(s).

I'm having a compiler issue

Unlikely.
What is more likely is that the compiler has an issue with your code.
The compiler has highlighted the exact location of the problem, but for some strange reason, you have chosen not to share that information.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom.. :slight_smile:

Hi,
In the IDE select TOOLS and then Auto-Format.

That will detent your code so you can see how many { and } you have.

You seem to have too many } brackets.

You should have the same amount of { as } .

Your last if.. statement is not complete..

Tom.. :slight_smile: