Hello, is it possible to make a variable greater than something and less than something else?
I have tried to make it but to no avail.
case '2':
{sensorValue= analogRead(LOL); // take out the int as not to re-define the Local variables
int dist=map(sensorValue, 105.5, 606.52, 46.1, 0);
Serial.print("Analog Reading: ");
Serial.print(sensorValue);
Serial.print(" Centemeters: ");
Serial.print(dist);
Serial.println("cm");
delay(10);
myservo.write(0);
}
while(150<sensorValue<600);
break;
Surely it also depends on what sensorvalue = in your test? if it is a value greater than 155 or less than 100 the argument will = False.
Edit to add:
In one of your other posts you mention an issue with it not stopping at 600? if you are testing if(100<sensorValue && sensorValue<600) and the value for the floor is 600 then the expression will always return false, 600 is not less than 600, the right test would need to be <= 600.