float frequency = map(sensorReading, 0, 1023, 100, 1000);

int frequency = map(constrain(sensorReading, 200, 800), 200, 800, 100, 1000);