In this Instructable i will teach you how to control a servo using a Photocell.
This is very simple and good for beginners.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Materials
1 x Photocell
1 x 10k Resistor
1 x Arduino
and some jumpers
Step 2: Wiring It Up
Wire everything following the schematic below.
Step 3: The Code
The Code is very simple:
val = analogRead(0);
val = map(val, 0, 1023, 0, 179);
Participated in the
3rd Epilog Challenge