{"id":694,"date":"2021-05-25T19:21:04","date_gmt":"2021-05-25T19:21:04","guid":{"rendered":"http:\/\/meatpie\/?p=694"},"modified":"2021-05-25T19:21:52","modified_gmt":"2021-05-25T19:21:52","slug":"connected-little-sandwich-box-button","status":"publish","type":"post","link":"https:\/\/snersbots.co.uk\/index.php\/connected-little-sandwich-box-button\/","title":{"rendered":"Connected Little Sandwich Box &#8211; Button"},"content":{"rendered":"\n<p>Added a button so that I can make the box do something. On the WEMOS the button sits between D5 and D0 &#8211; they are adjacent pins.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Commands<\/h2>\n\n\n\n<p>You need to activate the button as follows:<\/p>\n\n\n\n<p><code>pushbuttonfitted=yes<\/code><\/p>\n\n\n\n<p>These commands will change the colour on press and release:<\/p>\n\n\n\n<p><code>{\"process\":\"pixels\", \"command\":\"setnamedcolour\", \"colourname\":\"blue\", \"sensor\":\"button\", \"trigger\":\"pressed\"}<\/code><br><code>{\"process\":\"pixels\", \"command\":\"setnamedcolour\", \"colourname\":\"green\", \"sensor\":\"button\", \"trigger\":\"released\"}<\/code><\/p>\n\n\n\n<p>Make sure you do the <code>pressed<\/code> command first, otherwise it errors.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Triggering remote boxes<\/h2>\n\n\n\n<p><code>{\"process\":\"pixels\", \"command\":\"setnamedcolour\", \"colourname\":\"red\", \"sensor\":\"button\", \"trigger\":\"pressed\", \"to\":\"lb\/command\/CLB-d1f6de\"}<\/code><br><code>{\"process\":\"pixels\", \"command\":\"setnamedcolour\", \"colourname\":\"purple\", \"sensor\":\"button\", \"trigger\":\"released\", \"to\":\"lb\/command\/CLB-d1f6de\"}<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Managing triggers<\/h2>\n\n\n\n<p>To find out what triggers your box has, type <code>listeners<\/code><\/p>\n\n\n\n<p>To clear the triggers, type <code>clear listeners<\/code><\/p>\n\n\n\n<figure class=\"wp-block-gallery columns-2 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"577\" height=\"433\" src=\"http:\/\/meatpie\/wp-content\/uploads\/2021\/05\/CLSB-Released.jpg\" alt=\"\" data-id=\"706\" data-full-url=\"http:\/\/meatpie\/wp-content\/uploads\/2021\/05\/CLSB-Released.jpg\" data-link=\"http:\/\/meatpie\/?attachment_id=706\" class=\"wp-image-706\" srcset=\"https:\/\/snersbots.co.uk\/wp-content\/uploads\/2021\/05\/CLSB-Released.jpg 577w, https:\/\/snersbots.co.uk\/wp-content\/uploads\/2021\/05\/CLSB-Released-300x225.jpg 300w\" sizes=\"auto, (max-width: 577px) 100vw, 577px\" \/><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"577\" height=\"433\" src=\"http:\/\/meatpie\/wp-content\/uploads\/2021\/05\/CLSB-Pressed.jpg\" alt=\"\" data-id=\"705\" data-full-url=\"http:\/\/meatpie\/wp-content\/uploads\/2021\/05\/CLSB-Pressed.jpg\" data-link=\"http:\/\/meatpie\/?attachment_id=705\" class=\"wp-image-705\" srcset=\"https:\/\/snersbots.co.uk\/wp-content\/uploads\/2021\/05\/CLSB-Pressed.jpg 577w, https:\/\/snersbots.co.uk\/wp-content\/uploads\/2021\/05\/CLSB-Pressed-300x225.jpg 300w\" sizes=\"auto, (max-width: 577px) 100vw, 577px\" \/><\/figure><\/li><\/ul><figcaption class=\"blocks-gallery-caption\">Released is green and purple, pressed is blue and red<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Added a button so that I can make the box do something. On the WEMOS the button sits between D5 and D0 &#8211; they are adjacent pins.<\/p>\n","protected":false},"author":1,"featured_media":708,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,11],"tags":[41,42],"class_list":["post-694","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-electronics","category-other-projects","tag-connected-little-boxes","tag-wemos"],"_links":{"self":[{"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/694","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=694"}],"version-history":[{"count":9,"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/694\/revisions"}],"predecessor-version":[{"id":709,"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/694\/revisions\/709"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/media\/708"}],"wp:attachment":[{"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/categories?post=694"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/tags?post=694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}