O que o PWM Realmente Faz
Pulsos rápidos de ligado/desligado que funcionam como um regulador de brilho.
O que o PWM Realmente Faz é uma aula grátis de Arduino & IoT Academy no CoddyKit. Esta é a aula 1 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de Arduino & IoT Academy, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de Arduino & IoT Academy inclui 4 aulas no total.
Partes desta aula ainda não foram traduzidas e aparecem em 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. 🎉
Perguntas Frequentes
A aula “O que o PWM Realmente Faz” é grátis?
Sim — o texto completo de “O que o PWM Realmente Faz” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de Arduino & IoT Academy, atualize para CoddyKit PRO. O curso de Arduino & IoT Academy inclui 4 aulas no total.
O que vou aprender em “O que o PWM Realmente Faz”?
Pulsos rápidos de ligado/desligado que funcionam como um regulador de brilho. Você pratica Arduino & IoT Academy com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.
Preciso ter experiência prévia para começar Arduino & IoT Academy?
Nenhuma experiência prévia é necessária. Arduino & IoT Academy no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 1 de 4.
Quanto tempo leva a aula “O que o PWM Realmente Faz”?
A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.
Posso escrever e executar código nesta aula de Arduino & IoT Academy?
Sim. Cada aula de Arduino & IoT Academy inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.
Todas as aulas deste curso
- O que o PWM Realmente Faz
- analogWrite 0–255
- Aumente e Diminua o Brilho de um LED
- O Botão Controla o Brilho do LED