{"id":1070,"date":"2013-07-17T19:35:32","date_gmt":"2013-07-17T19:35:32","guid":{"rendered":"http:\/\/xronosclock.com\/home\/?p=1070"},"modified":"2019-02-15T11:46:30","modified_gmt":"2019-02-15T11:46:30","slug":"remote-control-for-xronos-clock","status":"publish","type":"post","link":"http:\/\/xronosclock.com\/home\/?p=1070","title":{"rendered":"Remote Control for Xronos Clock!"},"content":{"rendered":"<p><a href=\"http:\/\/xronosclock.com\/home\/wp-content\/uploads\/2013\/07\/avon_remote.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-1071\" alt=\"avon_remote\" src=\"http:\/\/xronosclock.com\/home\/wp-content\/uploads\/2013\/07\/avon_remote-270x300.jpg\" width=\"270\" height=\"300\" \/><\/a><\/p>\n<p>I&#8217;m super happy today, because I got IR remote control working with Xronos clock!\u00a0 Thanks to <a href=\"https:\/\/github.com\/shirriff\/Arduino-IRremote\">this IR library<\/a>, that was pretty easy task. Library worked out of the box for ATMega644p\/1284p (well actually only on 1284p, but more on this later).<br \/>\nI figured out a &#8220;hack&#8221; to add function for remote control that doesn&#8217;t affect any other clock code! See details after break.<\/p>\n<p><!--more--><\/p>\n<blockquote><p>\/\/ ===================================================================<br \/>\n\/\/ * Decode IR Codes *<br \/>\n\/\/ ===================================================================<br \/>\nvoid IR_process () {<br \/>\nif (irrecv.decode(&amp;results)) {<br \/>\nswitch (results.value) {<br \/>\ncase IR_ON:<br \/>\nlastButtonTime=millis()+ BOUNCE_TIME_BUTTON;<br \/>\nprocessMenuButton();<br \/>\nbreak;<br \/>\ncase IR_PLUS:<br \/>\nSerial.println (&#8220;Recieved PLUS&#8221;);<br \/>\ndecrement=false;<br \/>\nlastButtonTime=millis()+ BOUNCE_TIME_BUTTON;<br \/>\nprocessIncButton();<br \/>\nbreak;<br \/>\ncase IR_MINUS:<br \/>\nSerial.println (&#8220;Recieved MINUS&#8221;);<br \/>\ndecrement=true;<br \/>\nlastButtonTime=millis()+ BOUNCE_TIME_BUTTON;<br \/>\nprocessIncButton();<br \/>\nbreak;<br \/>\ncase IR_UP:<br \/>\nSerial.println (&#8220;Recieved UP&#8221;);<br \/>\nlastButtonTime=millis()+ BOUNCE_TIME_BUTTON;<br \/>\nprocessSetButton();<br \/>\nbreak;<br \/>\ncase IR_DOWN:<br \/>\nSerial.println (&#8220;Recieved DOWN&#8221;);<br \/>\nlastButtonTime=millis()+ BOUNCE_TIME_BUTTON;<br \/>\nprocessSetButton();<br \/>\nbreak;<br \/>\ncase IR_ENTER:<br \/>\nSerial.println (&#8220;Recieved ENTER&#8221;);<br \/>\nbreak;<br \/>\ncase IR_MUTE: \/\/ Start Talk function<br \/>\nSerial.println (&#8220;Recieved MUTE&#8221;);<br \/>\nlastButtonTime=millis()+BOUNCE_TIME_QUICK;<br \/>\nbuttonReleased=true;<br \/>\nlast_ms=millis();<br \/>\nquickDisplay();<\/p>\n<p>break;<\/p>\n<p>\/\/Serial.println(results.value, HEX);<\/p>\n<p>}<br \/>\nirrecv.resume(); \/\/ Receive the next value<br \/>\n}<br \/>\n}<\/p><\/blockquote>\n<p>IR_ON, IR_PLUS, etc are preset IR HEX codes that I got back by running<br \/>\n<em>Serial.println(results.value, HEX);\u00a0<\/em><br \/>\nFor example:<br \/>\n<em>#define IR_ON\u00a0 0x17E18E7 <\/em><br \/>\nIt can be adopted to any remote!<\/p>\n<p>And then I went further and added &#8220;decrement&#8221; functionality, so now with remote you can increase or decrease items (i.e. hours, minutes, etc.).<\/p>\n<p>It works fairly well, although there&#8217;s some lag as clock now have to process a lot more information.<\/p>\n<p>Bad news is, it now doesn&#8217;t work with ATMega644p chip at all because IR library eats a lot of RAM. But no issues with ATMega1284p. I might tweak IR library to make it smaller, after all I don&#8217;t need to send any IR codes, only receive..<\/p>\n<p>Additionally I figured there&#8217;s a room in current enclosure to attach IR receiver, however faceplate will block it, so it will need to be modified \ud83d\ude41<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m super happy today, because I got IR remote control working with Xronos clock!\u00a0 Thanks to this IR library, that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1071,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[12],"tags":[],"class_list":["post-1070","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-work-in-progress"],"_links":{"self":[{"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=\/wp\/v2\/posts\/1070","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1070"}],"version-history":[{"count":3,"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=\/wp\/v2\/posts\/1070\/revisions"}],"predecessor-version":[{"id":3924,"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=\/wp\/v2\/posts\/1070\/revisions\/3924"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=\/wp\/v2\/media\/1071"}],"wp:attachment":[{"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1070"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1070"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1070"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}