{"id":270,"date":"2018-05-30T14:37:59","date_gmt":"2018-05-30T14:37:59","guid":{"rendered":"https:\/\/arduino-developer.com\/arduino\/?p=270"},"modified":"2018-05-30T16:53:17","modified_gmt":"2018-05-30T16:53:17","slug":"uno-comparator-interrupt","status":"publish","type":"post","link":"https:\/\/arduino-developer.com\/arduino\/programming\/interrupts\/uno-comparator-interrupt","title":{"rendered":"UNO-Comparator Interrupt"},"content":{"rendered":"<h5>\nInitialise<br \/>\n<\/h5>\n<pre>\r\n<code>\r\n  \/\/Enable gobal interrupts (should already be enabled but do anyway)\r\n  SREG = SREG | B10000000;\r\n<\/code><\/pre>\n<h5>\nTurning interrupt on<br \/>\n<\/h5>\n<pre>\r\n<code>\r\n  \/\/Enable analog comparator interrupt\r\n  ACSR = B00000010;        \/\/On failing edge (bit 1=1), AIN0 applied to positive input of the analog comparator (bit6=0)\r\n\r\n  ACSR = ACSR | B00001000;        \/\/ Enable analog comparator interrupt (bit 3).\r\n<\/code><\/pre>\n<h5>\nTurning interrupt off<br \/>\n<\/h5>\n<pre>\r\n<code>\r\n  ACSR = 0;\r\n<\/code><\/pre>\n<h5>\nInterrupt function<br \/>\n<\/h5>\n<pre>\r\n<code>\r\nISR(ANALOG_COMP_vect)\r\n{\r\n\r\n\r\n}\r\n<\/code><\/pre>\n<p>\n&nbsp;\n<\/p>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Initialise \/\/Enable gobal interrupts (should already be enabled but do anyway) SREG = SREG | B10000000; Turning interrupt on \/\/Enable analog comparator interrupt ACSR = B00000010; \/\/On failing edge (bit 1=1), AIN0 applied to positive input of the analog comparator (bit6=0) ACSR = ACSR | B00001000; \/\/ Enable analog comparator interrupt (bit 3). Turning interrupt [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-270","post","type-post","status-publish","format-standard","hentry","category-interrupts"],"_links":{"self":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/270","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=270"}],"version-history":[{"count":4,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/270\/revisions"}],"predecessor-version":[{"id":279,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/270\/revisions\/279"}],"wp:attachment":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/media?parent=270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/categories?post=270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/tags?post=270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}