From PWM to voltage
The Arduino library has always had an “analog Write()” function, even though the AT mega doesn’t have any way to generate a varying voltage. So why the name? Well, what most microcontrollers can do is generate a pulse-width modulated signal, also known as PWM. That’s just a fancy way of saying that the microcontroller periodically …