int USF = 1; int USR = 2; int LMF = 3; int LMR = 4;
int RMF = 6; int RMR = 7; int USLS = 9; int USRS = 10; int USSL = 11;
int USSR = 12; int Scan = 13; int BEEP = 0;
void setup() {
pinMode(USF, INPUT); pinMode(USR, INPUT); pinMode(USLS, INPUT); pinMode(USRS, INPUT);
pinMode(USSL, INPUT); pinMode(USSR, INPUT); pinMode(Scan, INPUT); pinMode(LMF, OUTPUT);
pinMode(LMR, OUTPUT); pinMode(RMF, OUTPUT); pinMode(RMR, OUTPUT); pinMode(BEEP, OUTPUT);
}
void loop() {
digitalWrite(LMF, LOW); digitalWrite(LMR, LOW); digitalWrite(RMF, LOW); digitalWrite(RMR, LOW);
if (USF == LOW) {
LMF = HIGH;
RMF = HIGH;
BEEP = LOW;
}
if (USF == HIGH) {
LMF = LOW; RMF = LOW;
if (USR = LOW) {
LMR = HIGH;
RMR = HIGH;
BEEP = HIGH;
}
if (USR == HIGH) {
LMR = LOW; RMR = LOW;
if (USRS == LOW && USLS == HIGH && USSR == LOW) {
LMR = LOW;
RMR = HIGH;
}
if (USLS == LOW && USRS == HIGH && USSL == LOW) {
LMR = HIGH;
RMR = LOW;
}
if (USR == HIGH && USRS == HIGH && USLS = HIGH) {
LMR = LOW; RMR = LOW; BEEP = HIGH;
}
}
}
}type or paste code here
Error I get when trying to Compile;
Error Compiling for board Arduino UNO
If I remove the lines below, it compiles
if (USR == HIGH && USRS == HIGH && USLS = HIGH) {LMR = LOW; RMR = LOW; BEEP = HIGH;
This line is similar to lines above it. Is there something I'm not seeing?
You might like to adopt the convention of putting each program statement on a new line.
It is the way most code you'll see is written, there is no good reason to save whatever you think you are saving, carriage returns? paper?
In fact, doing it your way makes you a very unproductive programmer, as typically that is measured in lines of code per unit of time, like a day. Think how important that would be if someone were paying you on that basis.
But mostly it's just harder to read, and you want us to have an easy time reading your code, amIright?