ما الذي يفعله PWM فعلًا
نبضات تشغيل وإيقاف سريعة تعمل كخافض إضاءة
ما الذي يفعله PWM فعلًا درس مجاني في Arduino & IoT Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Arduino & IoT Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Arduino & IoT Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
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. 🎉
الأسئلة الشائعة
هل درس «ما الذي يفعله PWM فعلًا» مجاني؟
نعم — نص درس «ما الذي يفعله PWM فعلًا» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Arduino & IoT Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Arduino & IoT Academy 4 دروس في المجموع.
ماذا ستتعلم في «ما الذي يفعله PWM فعلًا»؟
نبضات تشغيل وإيقاف سريعة تعمل كخافض إضاءة تتمرن على Arduino & IoT Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Arduino & IoT Academy؟
لا تُشترط خبرة سابقة. Arduino & IoT Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.
كم من الوقت يستغرق درس «ما الذي يفعله PWM فعلًا»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Arduino & IoT Academy هذا؟
نعم. كل درس في Arduino & IoT Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- ما الذي يفعله PWM فعلًا
- analogWrite من 0 إلى 255
- تلاشي إضاءة مصباح LED صعودًا وهبوطًا
- المقبض يتحكم في سطوع مصباح LED