Cover by Andrew K. Dennis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

Curtain control application

We will now write an application that leverages the photoresistor and uses this to control the motor. There are a few concepts we will cover quickly before we write the application, in order to provide you with a better understanding of how our software works.

Pulse Width Modulation

Pulse Width Modulation (PWM) is a method that leverages the digital pins to create an analog result. If a digital pin is switched on, it has a value of 5 V and if switched off, it has a value of 0 V; PWM allows us to simulate a value between these two ends.

Using our software, we can create what is known as a square wave . This method involves switching a pin on and off to create a steady signal to the device connected to the digital pin. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required