{"id":12296,"date":"2021-11-27T20:02:21","date_gmt":"2021-11-27T11:32:21","guid":{"rendered":"https:\/\/people.utm.my\/razman-ayop\/?p=12296"},"modified":"2021-11-27T20:02:34","modified_gmt":"2021-11-27T11:32:34","slug":"arduino-basics-change-your-pwm-frequency","status":"publish","type":"post","link":"https:\/\/people.utm.my\/razman-ayop\/arduino-basics-change-your-pwm-frequency\/","title":{"rendered":"Arduino Basics Change your PWM Frequency"},"content":{"rendered":"\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Arduino Basics Change your PWM Frequency\" width=\"1080\" height=\"608\" src=\"https:\/\/www.youtube.com\/embed\/gMB88fXOZ-g?feature=oembed\"  allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Arduino Basics: PWM Frequency The PWM frequencies in Arduino a pretty much set. You can&#8217;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&#8217;s you change the frequency of the PWM pins in the IDE with the SetPinFrequencySafe() function. You can download this library here: <a href=\"https:\/\/www.youtube.com\/redirect?event=video_description&amp;redir_token=QUFFLUhqa2VvS1Bva20tbDl2TjZFSnZXVVRVVDh0NDJjUXxBQ3Jtc0trOUFKVm5LN0tHUUgtekFueGxBUENLak43N3JNV3Z3SmF0TkxQTjdKakZVQUg5YkZoVlkzNkRqTW50Yl9JaFMwN2dJaTE4elZRUHRTSkVLN1RlNHR2bFJJTnJNSE9lTlpSdHBzcmRoMzQ4WjdxbFJRUQ&amp;q=https%3A%2F%2Fcode.google.com%2Farchive%2Fp%2Farduino-pwm-frequency-library%2Fdownloads\" rel=\"noreferrer noopener\" target=\"_blank\">https:\/\/code.google.com\/archive\/p\/ard&#8230;<\/a> The frequency counter I used in this video is from BangGood.com. It&#8217;s a kit, and it&#8217;s available here: Geekcreit\u00ae DIY Frequency Tester 1Hz-50MHz Crystal Counter &#8212; <a href=\"https:\/\/www.youtube.com\/redirect?event=video_description&amp;redir_token=QUFFLUhqbElsWU9hT3lJT29rRUpRbGJZUncxT0VwZ2RBd3xBQ3Jtc0tsdUNBX0QzckluYXFzNk1wLThmMmlKSUU0OTc0RlhxejRYNVZOdTZhTE5SMzF6dy1XQWtSWjRZWTZlYWxzYzNxc2I5WmxuVTY1MzdjM2hkdjgxZllWXy1qb0dMVnVyS2ItLVNKV2F5cVhLOW5DVlVSdw&amp;q=https%3A%2F%2Fgoo.gl%2FDCy9Pz\" rel=\"noreferrer noopener\" target=\"_blank\">https:\/\/goo.gl\/DCy9Pz<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Arduino Basics: PWM Frequency The PWM frequencies in Arduino a pretty much set. You can&#8217;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 [&hellip;]<\/p>\n","protected":false},"author":24954,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"video","meta":{"_et_pb_use_builder":"off","_et_pb_old_content":"","_et_gb_content_width":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[32],"tags":[],"class_list":["post-12296","post","type-post","status-publish","format-video","hentry","category-research-guidance","post_format-post-format-video"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/people.utm.my\/razman-ayop\/wp-json\/wp\/v2\/posts\/12296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/people.utm.my\/razman-ayop\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/people.utm.my\/razman-ayop\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/people.utm.my\/razman-ayop\/wp-json\/wp\/v2\/users\/24954"}],"replies":[{"embeddable":true,"href":"https:\/\/people.utm.my\/razman-ayop\/wp-json\/wp\/v2\/comments?post=12296"}],"version-history":[{"count":1,"href":"https:\/\/people.utm.my\/razman-ayop\/wp-json\/wp\/v2\/posts\/12296\/revisions"}],"predecessor-version":[{"id":12298,"href":"https:\/\/people.utm.my\/razman-ayop\/wp-json\/wp\/v2\/posts\/12296\/revisions\/12298"}],"wp:attachment":[{"href":"https:\/\/people.utm.my\/razman-ayop\/wp-json\/wp\/v2\/media?parent=12296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/people.utm.my\/razman-ayop\/wp-json\/wp\/v2\/categories?post=12296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/people.utm.my\/razman-ayop\/wp-json\/wp\/v2\/tags?post=12296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}