{"id":245,"date":"2016-10-31T15:07:39","date_gmt":"2016-10-31T15:07:39","guid":{"rendered":"https:\/\/arduino-developer.com\/arduino\/?p=245"},"modified":"2020-02-26T20:41:42","modified_gmt":"2020-02-26T20:41:42","slug":"timer1-library","status":"publish","type":"post","link":"https:\/\/arduino-developer.com\/arduino\/programming\/timing\/timer1-library","title":{"rendered":"Timer1 Library"},"content":{"rendered":"\n<p>Arduino page for it <a href=\"http:\/\/playground.arduino.cc\/Code\/Timer1\">here<\/a>.<\/p>\n\n\n\n<p>Download from <a href=\"http:\/\/code.google.com\/p\/arduino-timerone\/downloads\/list\">here<\/a> or just install TimerOne using the Arduino libraries manager<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Using the Timer 1 Library For a Simple IRQ Timer<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;TimerOne.h>\n\n  \/\/Set the Timer 1 IRQ frequency\n  Timer1.initialize(10000);      \/\/Set the timer period in uS (this function will attempt to match using the available prescaller settings\n  \n  \/\/Set the timer 1 IRQ fucntion to be called\n  Timer1.attachInterrupt(timerIsr); \/\/ attach the service routine here\n  \n  \/\/Timer1.stop();            \/\/stop the timer\n  \/\/Timer1.start();           \/\/stop the timer\n  \/\/Timer1.restart();         \/\/set the clock to zero\n  \/\/Timer1.setPeriod(10000);  \/\/Set the timer period in uS (this function will attempt to match using the available prescaller settings<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/*****************************************\n\/\/*****************************************\n\/\/********** TIMER 1 IRQ HANDLER **********\n\/\/*****************************************\n\/\/*****************************************\nvoid timerIsr()\n{\n    \n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Arduino page for it here. Download from here or just install TimerOne using the Arduino libraries manager Using the Timer 1 Library For a Simple IRQ Timer<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-245","post","type-post","status-publish","format-standard","hentry","category-timing"],"_links":{"self":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/245","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=245"}],"version-history":[{"count":2,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/245\/revisions"}],"predecessor-version":[{"id":553,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/245\/revisions\/553"}],"wp:attachment":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/media?parent=245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/categories?post=245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/tags?post=245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}