Input Devices

Reading the Photoresistor Values

In Week06 and Week08 I already prepared this Assignment, because I added a photoresistor to my board and also prepared the programming of the board to read values from the photoresistor. Because of this, this assignment was realy quick to do. To test the values of the photoresistor I forwarded the values to the LED on my board to see whether I can dim it with covering of the photoresistor. At first the LED behaved a little strange at either burned bright or began flickering. I got the hint from a colleague that you need to divide the values of the photoresistor by 2. Sadly so far no one knew why this works but it worked in the end. For the flower project I also added a filter, such that the flower does not opens and closes like crazy if the values of the photoresistor flicker around the threshold which opens the flower.




Code File for the Flower with the implemented Filter