I received my first Arduino in the mail the other day. Of course I went through all the tutorials and started tinkering right away. But I won’t bore you with those details…God knows there are too many “I plugged in an LED and got the Blink program running” out there already. But I did design a quick little circuit that I thought might be handy as a tutorial for beginners (like myself).
For the physical setup, all you need is an LED with a 220Ω resistor connected to pin 11, and a photocell connected to pin 2 with a 5V pulldown configuration (see pictures). I’ve attached the sketch code to the post…upload the sketch to your Arduino and say goodbye to the boogie monster. Click here to download sketch code.