0Pricing
Arduino & IoT Academy · レッスン

PWM の実際の動作

調光器のように働く高速なオン・オフパルスを学びます

「PWM の実際の動作」はCoddyKit上の無料Arduino & IoT Academyレッスンです。 これはレッスン1/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これは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 pin

Quick 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時間対応のAIチューター)、Arduino & IoT Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Arduino & IoT Academyコースには全4レッスンが含まれています。

「PWM の実際の動作」で何を学びますか?

調光器のように働く高速なオン・オフパルスを学びます ブラウザで直接実行するハンズオンコードでArduino & IoT Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

Arduino & IoT Academyを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのArduino & IoT Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン1/4です。

「PWM の実際の動作」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このArduino & IoT Academyレッスンでコードを書いて実行できますか?

はい。すべてのArduino & IoT Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. PWM の実際の動作
  2. analogWrite 0~255
  3. LED を明るくしたり暗くしたりする
  4. つまみで LED の明るさを制御する
← Arduino & IoT Academyに戻る