I just started looking into electronics and circuits. I purchased the Arduino Starter Kit to help get me started. I have a question regarding one of the 15 projects it comes with. Specifically with project 4. Basically the the project introduces photoresistors, in this case 3, and the multi light LED, which I believe is a standard RGB LED.
The part I don't understand is that we have to make a calculation for the resistor readings. We have to convert the reading, which would be in a range of 0-1023 to a range of 0-255 for the analogWrite() function. The calculation is very simple, just divide the reading by 4 and you get a measurement within the 0-255 range.
I don't understand the need for the conversion. What is the need for it? Why is the sensor range 0-1023 and not some other range? All I get from the reading is that it is needed for the function and doesn't go into any more detail other than that. I'm sure it is something fundamental that I am just not seeing.
Any point in the right direction would be appreciated. Thanks!