this was supposed to be the code for a single potentiometer lock system but i keep getting the error "value not ignored as it ought to be" and since im still new at using the arduino and programming in in genaral i dont know what to do. Could anyone plz give me some tips on changes i should make to the code.
int r1 = A0;
int r2 = A1;
int button = 6;
int led1 = 13;
int led2 = 12;
int led3 = 11;
void setup()
{
Serial.begin(9600);
pinMode(button,INPUT);
pinMode(led1,OUTPUT);
pinMode(led2,OUTPUT);
pinMode(led3,OUTPUT);
}
void loop()
{
int val1 = analogRead(r1);
if(val1 == 598 && digitalRead(button) == HIGH) Serial.println( "acess1 clear")
&& digitalWrite(led1,HIGH);
if(val1 == 450 && digitalRead(button) == HIGH && digitalWrite(led1,HIGH))
Serial.println( "acess2 clear") && digitalWrite(led2,HIGH);
if(val1 == 1023 && digitalRead(button) == HIGH && digitalWrite(led2,HIGH))
Serial.println( "acess granted") && digitalWrite(led3,HIGH) ;
Serial.println(val1);
delay(1000);
}