{"id":794,"date":"2010-03-20T19:00:00","date_gmt":"2010-03-20T19:00:00","guid":{"rendered":"https:\/\/theshanty.us\/?p=794"},"modified":"2025-08-04T19:06:20","modified_gmt":"2025-08-04T19:06:20","slug":"push-on-push-off","status":"publish","type":"post","link":"http:\/\/blog.theshanty.us\/index.php\/2010\/03\/20\/push-on-push-off\/","title":{"rendered":"Push on Push off"},"content":{"rendered":"\n<p>I&#8217;ll test the code in the morning.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#define LED 13\n#define BUTTON 7\n\nint val = 0;\nint state = 0;\n\nvoid setup {\n  pinMode(LED, OUTPUT)\n  pinMode(BUTTON, INPUT)\n}\n\nvoid loop {\n  val = digitalRead(BUTTON);\n  \n  if (val == HIGH &amp;&amp; state == 0) {\n    digitalWrite(LED, HIGH);\n    pause(500);\n    state = 1;\n  }\n  if ((val == HIGH) &amp;&amp; (state == 1)){\n    digitalWrite(LED, LOW);\n    pause(500);\n    state = 0;\n  }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ll test the code in the morning.<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[78,43],"tags":[],"class_list":["post-794","post","type-post","status-publish","format-standard","hentry","category-arduino","category-coding"],"featured_image_urls":{"full":"","thumbnail":"","medium":"","medium_large":"","large":"","1536x1536":"","2048x2048":"","chromenews-featured":"","chromenews-large":"","chromenews-medium":""},"author_info":{"display_name":"chuckularone","author_link":"http:\/\/blog.theshanty.us\/index.php\/author\/chuckularone\/"},"category_info":"<a href=\"http:\/\/blog.theshanty.us\/index.php\/category\/arduino\/\" rel=\"category tag\">Arduino<\/a> <a href=\"http:\/\/blog.theshanty.us\/index.php\/category\/coding\/\" rel=\"category tag\">Coding<\/a>","tag_info":"Coding","comment_count":"0","_links":{"self":[{"href":"http:\/\/blog.theshanty.us\/index.php\/wp-json\/wp\/v2\/posts\/794"}],"collection":[{"href":"http:\/\/blog.theshanty.us\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.theshanty.us\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.theshanty.us\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.theshanty.us\/index.php\/wp-json\/wp\/v2\/comments?post=794"}],"version-history":[{"count":1,"href":"http:\/\/blog.theshanty.us\/index.php\/wp-json\/wp\/v2\/posts\/794\/revisions"}],"predecessor-version":[{"id":795,"href":"http:\/\/blog.theshanty.us\/index.php\/wp-json\/wp\/v2\/posts\/794\/revisions\/795"}],"wp:attachment":[{"href":"http:\/\/blog.theshanty.us\/index.php\/wp-json\/wp\/v2\/media?parent=794"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.theshanty.us\/index.php\/wp-json\/wp\/v2\/categories?post=794"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.theshanty.us\/index.php\/wp-json\/wp\/v2\/tags?post=794"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}