Building the Solution

We have several objectives to complete for our project to work as intended. First, we will test the stepper motor by writing a sketch using Adafruit’s AFMotor library. This assumes that you have already constructed the motor shield. Follow the instructions on Adafruit’s website for more details on assembling and using the motor shield.[82]

After we have a working stepper motor’s drive shaft that rotates back and forth based on the instructions we have the Arduino execute, we will hook up the photo resistor. We will borrow from the same light sensor routine we wrote for the Chapter 5, Tweeting Bird Feeder. When this photosensor detects light that exceeds the threshold we establish, the stepper motor drive shaft will ...

Get Programming Your Home now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.