Загрузка страницы

Arduino Basics Change your PWM Frequency

Arduino Basics: PWM Frequency

The PWM frequencies in Arduino a pretty much set. You can't really change them from the IDE. For example, pin 9 PWM frequency is set at 490Hz. Other pins have different frequencies, which are controlled by the Atmega 328P timers.
You can change the pre-scaler for these timers and effectively change the frequency, but it can be a bit of a bother to look up the code.
But, the good news is that there is a library, called PWM that let's you change the frequency of the PWM pins in the IDE with the SetPinFrequencySafe() function.
You can download this library here: https://code.google.com/archive/p/arduino-pwm-frequency-library/downloads

The frequency counter I used in this video is from BangGood.com. It's a kit, and it's available here: Geekcreit® DIY Frequency Tester 1Hz-50MHz Crystal Counter -- https://goo.gl/DCy9Pz

-~-~~-~~~-~~-~-
Please watch: "Diodes: The basic building block of all digital circuits"
https://www.youtube.com/watch?v=Lyii5I30gw0
-~-~~-~~~-~~-~-

Видео Arduino Basics Change your PWM Frequency канала learnelectronics
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
4 июня 2017 г. 18:30:00
00:07:36
Яндекс.Метрика