{"id":51,"date":"2013-10-24T15:59:37","date_gmt":"2013-10-24T15:59:37","guid":{"rendered":"https:\/\/arduino-developer.com\/arduino\/?p=51"},"modified":"2019-04-04T12:11:07","modified_gmt":"2019-04-04T12:11:07","slug":"pwm-outputs","status":"publish","type":"post","link":"https:\/\/arduino-developer.com\/arduino\/programming\/pwm\/pwm-outputs","title":{"rendered":"PWM Outputs"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Using PWM Output Pins <\/h4>\n\n\n\n<p>To set the PWM period on any pin which can be used for PWM use the following: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  analogWrite(3, 127);      \/\/PinId, PWM period from 0 to 255<\/code><\/pre>\n\n\n\n<p>There is no need to set the pin as an output as it will be automatically set as one. \nThe PWM frequency is fixed at approximately 490 Hz.\n<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Boards With > 8 Bit PWM Resolution <\/h4>\n\n\n\n<p>Most boards are 8bit.  Some can use higher resolutions on some of the pins by using special commands.  A few Arduinos support analogWriteResolution() function to set the resolution in use. <\/p>\n\n\n\n<p><a href=\"https:\/\/www.arduino.cc\/reference\/en\/language\/functions\/zero-due-mkr-family\/analogwriteresolution\/\">https:\/\/www.arduino.cc\/reference\/en\/language\/functions\/zero-due-mkr-family\/analogwriteresolution\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using PWM Output Pins To set the PWM period on any pin which can be used for PWM use the following: There is no need to set the pin as an output as it will be automatically set as one. The PWM frequency is fixed at approximately 490 Hz. Boards With > 8 Bit PWM [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-51","post","type-post","status-publish","format-standard","hentry","category-pwm"],"_links":{"self":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/51","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/comments?post=51"}],"version-history":[{"count":6,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/51\/revisions"}],"predecessor-version":[{"id":387,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/51\/revisions\/387"}],"wp:attachment":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/media?parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/categories?post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/tags?post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}