user18905: This photoresistor has a min/max of 0-1023.
I'm trying to scale the brightness of a cathode RGB LED based on the sensor's value, but based on my current lighting, the min/max readings I generally am getting are 100-700.
So how can I scale the sensor reading so that 100 = no light on the LED and 700 = max brightness? 

user2926: You can easily scale in Arduino code with the map() function.
e.g.:
const int MIN_LIGHT 100;
const int MAX_LIGHT 700;

int light_reading = analogRead(A0);

// Convert MIN reading (100) -> MAX reading (700) to a range 0->100.
int percentage_bright = map(light_reading, MIN_LIGHT, MAX_LIGHT, 0, 100);

But you may need some calibration of your system to handle different ambient light situations. What reading do you get in direct sunlight for example?
So then I assume you're using PWM (Pulse Width Modulation) to drive the LED.  This requires a value between 0 & 255.  Once again we can use the map() function.
// Convert light-value % (0-100) to PWM speed (0-255)
int led_brightness = map(percentage_bright, 0, 100, 0, 255);
analogWrite(LED_PIN_RED, led_brightness);

Obviously these bits of code can be reduced down to a single line - mapping directly from the reading to the desired result.

18905: <p>This photoresistor has a min/max of 0-1023.</p>

<p>I'm trying to scale the brightness of a cathode RGB LED based on the sensor's value, but based on my current lighting, the min/max readings I generally am getting are 100-700.</p>

<p>So how can I scale the sensor reading so that 100 = no light on the LED and 700 = max brightness? </p>
 2926: <p>You can easily scale in Arduino code with the <a href="https://www.arduino.cc/en/Reference/Map" rel="nofollow">map()</a> function.</p>

<p>e.g.:</p>

<pre><code>const int MIN_LIGHT 100;
const int MAX_LIGHT 700;

int light_reading = analogRead(A0);

// Convert MIN reading (100) -&gt; MAX reading (700) to a range 0-&gt;100.
int percentage_bright = map(light_reading, MIN_LIGHT, MAX_LIGHT, 0, 100);
</code></pre>

<p>But you may need some calibration of your system to handle different ambient light situations. What reading do you get in direct sunlight for example?</p>

<p>So then I assume you're using PWM (Pulse Width Modulation) to drive the LED.  This requires a value between 0 &amp; 255.  Once again we can use the map() function.</p>

<pre><code>// Convert light-value % (0-100) to PWM speed (0-255)
int led_brightness = map(percentage_bright, 0, 100, 0, 255);
analogWrite(LED_PIN_RED, led_brightness);
</code></pre>

<p>Obviously these bits of code can be reduced down to a single line - mapping directly from the reading to the desired result.</p>
