Qué hace realmente PWM
Pulsos rápidos de encendido y apagado que actúan como un regulador
Qué hace realmente PWM es una lección gratuita de Arduino & IoT Academy en CoddyKit. Esta es la lección 1 de 4. Puedes leer la lección completa abajo gratuitamente — luego la practicas en el navegador con un editor de código integrado y un tutor de IA 24/7. Forma parte de la ruta de aprendizaje de Arduino & IoT Academy, y tu progreso se sincroniza en la web y la app de CoddyKit. El curso de Arduino & IoT Academy incluye 4 lecciones en total.
Partes de esta lección aún no han sido traducidas y se muestran en inglés.
A Pin That Only Knows On or Off
A digital pin can only output full voltage or none at all. So how do you get a dim LED instead of just bright or dark? 💡
The Trick: Switch Very Fast
The answer is PWM: turn the pin on and off so quickly that your eye blends the flickers into one steady, in-between brightness.
PWM Stands For This
PWM means Pulse Width Modulation. You keep flipping the pin, and you change how wide each on-pulse is to control the average power.
Meet the Duty Cycle
The duty cycle is the percent of each cycle the pin stays on. 50% on means roughly half power and a half-bright LED.
More On-Time, More Power
A wider pulse means more on-time, so the LED looks brighter or a motor spins faster. Narrow pulses give you dim and slow.
It Is Still Digital
PWM never outputs a true middle voltage. The pin is always fully HIGH or fully LOW, just switching fast enough to feel smooth.
Your Eyes Do the Blending
The LED really does flicker, but the switching is so fast that persistence of vision makes it look like one constant level.
Frequency Keeps It Smooth
The frequency is how many on-off cycles happen each second. Arduino runs PWM around 490 Hz, fast enough to hide the flicker.
Only Some Pins Can Do It
Not every pin supports PWM. On an Uno, look for pins marked with a tilde symbol next to numbers like 3, 5, 6, 9, 10, and 11.
Where You Will Use It
PWM powers real effects: dimming an LED, fading lights, controlling motor speed, and even shaping simple tones from a buzzer. 🔊
One Command Sets It Up
In code you do not toggle the pin yourself. One built-in analogWrite call sets the duty cycle and the chip pulses for you.
analogWrite(9, 128); // ~50% duty on a PWM pinQuick Check
Let's lock in what PWM really controls.
Recap: PWM in a Nutshell
PWM fakes analog output by pulsing a digital pin fast. The duty cycle sets the power, and your eyes blend it into smooth brightness. 🎉
Preguntas frecuentes
¿La lección «Qué hace realmente PWM» es gratis?
Sí — el texto completo de «Qué hace realmente PWM» es gratis para leer aquí en la web. Para practicarla de forma interactiva (editor de código integrado y tutor de IA 24/7) y desbloquear el resto del curso de Arduino & IoT Academy, actualiza a CoddyKit PRO. El curso de Arduino & IoT Academy incluye 4 lecciones en total.
¿Qué aprenderé en «Qué hace realmente PWM»?
Pulsos rápidos de encendido y apagado que actúan como un regulador Practicas Arduino & IoT Academy con código real que ejecutas directamente en el navegador, y un tutor de IA 24/7 responde tus preguntas mientras trabajas en la lección.
¿Necesito experiencia previa para empezar Arduino & IoT Academy?
No se requiere experiencia previa. Arduino & IoT Academy en CoddyKit está estructurado para principiantes hasta estudiantes avanzados, así que puedes empezar aquí o desde el inicio y avanzar a tu ritmo. Esta es la lección 1 de 4.
¿Cuánto tiempo toma la lección «Qué hace realmente PWM»?
La mayoría de las lecciones de CoddyKit toman alrededor de 5–10 minutos. Cada una es compacta e interactiva, así que avanzas constantemente y retomas exactamente por donde dejaste en la web y la app.
¿Puedo escribir y ejecutar código en esta lección de Arduino & IoT Academy?
Sí. Cada lección de Arduino & IoT Academy incluye un editor de código integrado, así que escribes y ejecutas código real directamente en tu navegador y obtienes retroalimentación instantánea de IA — sin configuración local necesaria.
Todas las lecciones de este curso
- Qué hace realmente PWM
- analogWrite 0–255
- Atenúe un LED hacia arriba y hacia abajo
- El mando controla el brillo del LED