Back to Parent

Process

I first mapped 0-4095 to 0-255, but failed to feel the LED changing its brightness according to the surrounding light. Then I used cloud variable and output the reading of photoresistor, found that when I covered the sensor, the reading is around 2500, and when I didn't cover it, the reading is around 3700. Then I realized that the brightness of LED didn't fade was because the range 0-4095 is too large, no matter how the surrounding light changed, there was only a little difference after they are mapped to 0-255. Thus, I adjusted the range to 2500-4095. I also set the threshold to 3000 to indicate whether the sensor is covered or not.


Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0