Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Android Things Quick Start Guide

You're reading from  Android Things Quick Start Guide

Product type Book
Published in Aug 2018
Publisher Packt
ISBN-13 9781789341799
Pages 192 pages
Edition 1st Edition
Languages
Author (1):
Raul Portales Raul Portales
Profile icon Raul Portales

PWM as analog output

In the introduction we talked about the average value of a PWM signal. That average can be considered an analog value for the signal as long as the frequency is high enough that the circuits do not notice it. Many circuits will have voltage regulators to compensate for the variations on the input and in that case it will be in fact an analog output. This analog value is directly proportional to the duty cycle.

Since we only have one PWM available we will use a single color LED to visually understand how analog outputs work. In the case of the LED, the intensity of the brightness will be proportional to the value of the duty cycle.

We will use a red LED for this example, connected as shown in the following diagram. We connect the LED to the PWM pin, add a 330 Ω resistor to take care of the extra voltage, and then we connect again to ground. A mini breadboard...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}