Now for the Code!
I wrote up the code below. It basically reads the input from the photo-resistor at pin A0 and maps that onto the scale for LED pwm (pulse-width-modulation). That number is stored in a variable called ledBrightness and is reflected when the LED lights up by analogWrite statement.
Content Rating
Is this a good/useful/informative piece of content to include in the project? Have your say!
You must login before you can post a comment. .