constrain function in arduino
void setup() {
// Initialization code here
}
void loop() {
int sensorValue = analogRead(A0); // Read analog input from pin A0
int constrainedValue = constrain(sensorValue, 100, 500); // Constrain the sensor value between 100 and 500
// Perform further operations with constrainedValue
}