{"id":25,"date":"2013-10-24T14:44:54","date_gmt":"2013-10-24T14:44:54","guid":{"rendered":"https:\/\/arduino-developer.com\/arduino\/?p=25"},"modified":"2023-08-15T20:52:41","modified_gmt":"2023-08-15T19:52:41","slug":"delay","status":"publish","type":"post","link":"https:\/\/arduino-developer.com\/arduino\/programming\/delay\/delay","title":{"rendered":"Delay"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Delay 1 cycle<\/h4>\n\n\n\n<p>A&nbsp;nop instruction, allowing you to waste&nbsp;one cycle (62.5ns on a 16MHz Arduino) is created using this inline assembly:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>__asm__ __volatile__ (\"nop\\n\\t\");<\/code><\/pre>\n\n\n\n<p>Or can be made into a define&nbsp;using this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#define NOP __asm__ __volatile__ (\"nop\\n\\t\")<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Delay mS<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>  delay(1000);        \/\/Time in mS<\/code><\/pre>\n\n\n\n<p>Value is unsigned long, so up to\u00a04,294,967,295 (32-bit)<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Delay uS<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>  delayMicroseconds(30);<\/code><\/pre>\n\n\n\n<p>Value is unsigned int.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Delay nS<\/h4>\n\n\n\n<p>Supported by some boards<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  delayNanoseconds(500);<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Delay 1 cycle A&nbsp;nop instruction, allowing you to waste&nbsp;one cycle (62.5ns on a 16MHz Arduino) is created using this inline assembly: Or can be made into a define&nbsp;using this: Delay mS Value is unsigned long, so up to\u00a04,294,967,295 (32-bit) Delay uS Value is unsigned int. Delay nS Supported by some boards<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,15],"tags":[],"class_list":["post-25","post","type-post","status-publish","format-standard","hentry","category-delay","category-timing"],"_links":{"self":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/25","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=25"}],"version-history":[{"count":7,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/25\/revisions"}],"predecessor-version":[{"id":802,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/25\/revisions\/802"}],"wp:attachment":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/media?parent=25"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/categories?post=25"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/tags?post=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}