Robotics & Arduino
Lesson 2 · Refinement

Follow the light.

Let’s make a light-following robot.

Find the light again.

We have an LDR. It reacts to light.

When the light gets dimmer, the source may have moved. We want to try to find it again.

Mount the LDR on the servo so it turns with the motor.

Sweep across the room within the servo’s range, find the direction with the strongest light, and point toward it.

Your first independent assignment.

You have all the pieces.
You know how they work.
Now put them together.

This time, you lead.

Build it in this order.

1 — Think it through.
What should happen, and when?

2 — Write pseudocode.
Describe the steps in your own words.

3 — Build the circuit.
Connect the parts you have already learned to use.

4 — Add code, block by block.
Build up your program one working piece at a time.

Isolate. Test. Combine.

Use Serial to see what your program is reading and deciding.

Use functions to isolate each job and test it on its own.

When the individual parts work, put them together.