PWM is a powerful technique that can use to control the power that's delivered to an electronic component like LEDs and motors. Using PWM, we can perform operations like controlling the brightness of an LED or reducing the speed of a motor. In this section, we will first understand the way in which a PWM works and then we will write a simple PWM program to increase the brightness of an LED, step by step.
Pulse Width Modulation using softPWM
How PWM works
In the previous Blink.cpp program, we applied a digital signal from the RPi to the LED. Digital signals either have a HIGH state or a LOW state. In, HIGH, state the Raspberry Pi pins produces a voltage of 3.3V and in a LOW state, the pins produce a voltage of 0V. Consequently...