{"id":317,"date":"2013-01-26T11:45:00","date_gmt":"2013-01-26T11:45:00","guid":{"rendered":"http:\/\/thomas.w-p.me.uk\/blog\/2013\/01\/ardhuino-shift-register-74hc595-notes\/"},"modified":"2013-01-26T11:45:00","modified_gmt":"2013-01-26T11:45:00","slug":"ardhuino-shift-register-74hc595-notes","status":"publish","type":"post","link":"https:\/\/thomas.w-p.me.uk\/blog\/2013\/01\/ardhuino-shift-register-74hc595-notes\/","title":{"rendered":"Ardhuino Shift Register &#8211; 74HC595 notes"},"content":{"rendered":"<p>So, I am still playing with Arduino, and want to understand the shift register better.\u00a0 Notes as I go.<\/p>\n<ul>\n<li>I used <a href=\"http:\/\/arduino.cc\/en\/Tutorial\/ShiftOut\">this official page<\/a> to get up and running.\u00a0 I set it up and got the &#8220;Hello World&#8221; sketch running.\u00a0 It was all very deja vu and I realised that I&#8217;d been through all this before without really getting to grips with it (running before I could walk).\u00a0 My eureka moment was realising that you address the 8 pins all at once by a binary number up to 255.\u00a0 Suddenly it all makes sense (255 = 11111111 in binary so turns all 8 inputs HIGH, 129 is 10000001 which turns the first and last inputs HIGH.<\/li>\n<li>function <a href=\"http:\/\/arduino.cc\/en\/Reference\/BitWrite\">bitWrite<\/a> appears to replace the bit in a binary number, so bitWrite(0,4,1) would change the number 0 to the number 1000 by placing a 1 4 digits in to the binary number.\u00a0 bitWrite(16,2,1) would change 1000 to 1010.\u00a0 The first parameter is the variable you are changing.<\/li>\n<li>function <a href=\"http:\/\/arduino.cc\/en\/Reference\/ShiftOut\">ShiftOut<\/a> fires out the bits in order then toggles the clock pin to tell the register the data is there.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>So, I am still playing with Arduino, and want to understand the shift register better.\u00a0 Notes as I go. I used this official page to get up and running.\u00a0 I set it up and got the &#8220;Hello World&#8221; sketch running.\u00a0 It was all very deja vu and I realised that I&#8217;d been through all this &hellip; <a href=\"https:\/\/thomas.w-p.me.uk\/blog\/2013\/01\/ardhuino-shift-register-74hc595-notes\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Ardhuino Shift Register &#8211; 74HC595 notes<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[41,43],"class_list":["post-317","post","type-post","status-publish","format-standard","hentry","tag-arduino","tag-shift-register"],"_links":{"self":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts\/317","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/comments?post=317"}],"version-history":[{"count":0,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts\/317\/revisions"}],"wp:attachment":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/media?parent=317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/categories?post=317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/tags?post=317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}