const int analogInputPin = A0;
const int outputMin = 10;
const int outputMax = 100;
void setup() {
Serial.begin(9600);
}
void loop() {
int sensorValue = analogRead(analogInputPin);
int mappedValue = map(sensorValue, 0, 1023, outputMin, outputMax);
int constrainedValue = constrain(mappedValue, outputMin, outputMax);
Serial.print("Raw Value: ");
Serial.print(sensorValue);
Serial.print(" | Mapped Value: ");
Serial.print(mappedValue);
Serial.print(" | Constrained Value: ");
Serial.println(constrainedValue);
delay(1000);
}