Hey there, I have the following code:
sVal = analogRead(potPin); // read the value from the sensor
valMin = min(sVal, 1);
valMax = max(sVal, 128);
constrain(sVal,valMin,valMax);
itoa(sVal, res, 10);
println(res);
println(" ");
delay(150);
clearScreen();
Now for some reason, the output on the gLCD screen is almost constantly 1023. I would like the minimum for the potentiometer to be 1 and the maximum to be 128.