Hello, i know that we cant give discrete values in case - switch it needs to be a spesific value but im using infrared Sharp GP2Y0D805Z0F sensor and it always gives different values i mean when i measure 20 cm i reading analog values to between 265-275 so changable. So rather than using if command how can i using it with Case - Switch.
val = analogRead(sensorpin);
if ((val > 265) && (val < 275))
So i need to write this with case-switch commands.