官术网_书友最值得收藏!

  • Mastering Arduino
  • Jon Hoffman
  • 162字
  • 2021-07-23 18:57:38

PWM pins

Where the analog input pins are designed to read analog sensors (input), the PWM pins are designed for output. PWM is a technique for obtaining analog results with digital output.

Since a digital output can be either on or off, to obtain the analog output the digital output is switch between HIGH and LOW rapidly. The percentage of the time that the signal is high is called the duty cycle. The following diagram illustrates this concept:

We have the ability to set the frequency of how fast the signal can switch between HIGH and LOW. This frequency is measured in Hertz and sets how many times the signal can switch per second. For example, if we set the frequency to 500 Hz, that would mean that the signal could switch 500 times a second.

We will be using the PWM pins for several examples in this book and will examine them more when we learn how to program the Arduino.

主站蜘蛛池模板: 彩票| 老河口市| 红原县| 宽甸| 香港| 通化县| 南涧| 忻州市| 图们市| 岢岚县| 威远县| 锡林郭勒盟| 江城| 封丘县| 科尔| 常州市| 尼勒克县| 台北市| 三原县| 沭阳县| 衡南县| 关岭| 道孚县| 平泉县| 连江县| 十堰市| 三穗县| 延川县| 华亭县| 乐山市| 志丹县| 松潘县| 昌吉市| 香港| 定兴县| 凌源市| 新沂市| 简阳市| 平塘县| 丽江市| 阳山县|