arduino code example - Tech-dat/PWM-dat/arduino-fading.ino
understand PWM
PWM (Pulse Width Modulation) - PPM-dat
What changes:
👉 Pulse width (duty cycle)
What stays fixed:
Frequency
Pulse position
|■■■■■■ | 60% duty
|■■■ | 30% duty
|■■■■■■■■ | 80% duty
Used for
- SMPS regulation
- Motor speed control
- LED dimming
boards
-
/* Fade
This example shows how to fade an LED on pin 9 using the analogWrite() function.
The analogWrite() function uses PWM, so if you want to change the pin you're using, be sure to use another PWM capable pin. On most Arduino, the PWM pins are identified with a "~" sign, like ~3, ~5, ~6, ~9, ~10 and ~11.
This example code is in the public domain.
drive chip
TL494 == Pulse-Width-Modulation Control Circuits
MIC38C42/43/44/45 - BiCMOS Current-Mode PWM Controllers - 20V, Current Mode SMPS Controller Family with Various UVLO and Max Duty Cycle - microchip-dat