{"id":807,"date":"2013-02-12T13:03:09","date_gmt":"2013-02-12T13:03:09","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=807"},"modified":"2019-05-23T09:51:44","modified_gmt":"2019-05-23T09:51:44","slug":"delays","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/programming-in-c\/timing\/delays","title":{"rendered":"Delays"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Linux Functions<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">usleep<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;unistd.h>\n\n\tusleep(1000);\t\t\/\/uS (unsigned int)<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">sleep<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>\tsleep(1.5);       \/\/Secs<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">BCM2835 Library<\/h4>\n\n\n\n<p>The\u00a0<a href=\"https:\/\/raspberry-projects.com\/pi\/programming-in-c\/c-libraries\/bcm2835-by-mike-mccauley\">bcm2835 library by Mike McCauley<\/a> includes some useful delay functions: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\tbcm2835_delayMicroseconds(100);\t\t\t\t\/\/Sleep occasionally so scheduler doesn't penalise us (THIS REQUIRES -lrt ADDING AS A COMPILER FLAG OR IT WILL CAUSE LOCK UP)\n    \t\n\tbcm2835_delay(1);\t\t\/\/Delay in mS<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Linux Functions usleep sleep BCM2835 Library The\u00a0bcm2835 library by Mike McCauley includes some useful delay functions:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48,24],"tags":[],"class_list":["post-807","post","type-post","status-publish","format-standard","hentry","category-delays","category-timing"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/807","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=807"}],"version-history":[{"count":4,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/807\/revisions"}],"predecessor-version":[{"id":3086,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/807\/revisions\/3086"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=807"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=807"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=807"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}