int RLED = 4; // RLED pin
int BLED = 3; // BLED pin
int YLED = 2; // YLED pin
int SW82R = 6;
int SW82N = 7;
int Asens = 9;
int Bsens = 10;
int Csens = 11;
int Track5 = 5;
int TempA = (HIGH);
int TempB = (HIGH);
int TempC = (HIGH);
int Track5BY = (HIGH);
void setup()
{
pinMode(RLED, OUTPUT);
pinMode(BLED, OUTPUT);
pinMode(YLED, OUTPUT);
pinMode(Asens, INPUT);
pinMode(Bsens, INPUT);
pinMode(Csens, INPUT);
pinMode(SW82R, OUTPUT);
pinMode(SW82N, OUTPUT);
Serial.begin(9600);
}
void loop()
{
Track5BY = digitalRead(Track5);
if (Track5BY == HIGH)
{
Serial.println("No Obstacle");
digitalWrite(BLED, LOW);
}
else
{
Serial.println("Obstacle");
digitalWrite(BLED, HIGH);
delay(1500);
}
} // Move this to below the TempA line and the code will compile
TempA = digitalRead(Asens);
There is your code posted in code tags and formatted. You see the TempA line is still outside of any function cause the loop is closed before that line.
So asking you to follow the rules is arrogance? We ask that code is posted in code tags because the forum software will mess certain things up and make code unreadable. We ask the the code be formatted to make if easy to read and follow (and therefore easier to debug). If that is to much for you I suggest that you try a different forum.