{"id":2722,"date":"2017-04-24T08:00:00","date_gmt":"2017-04-24T08:00:00","guid":{"rendered":"http:\/\/www.diogonunes.com\/blog\/?p=2722"},"modified":"2020-05-15T14:23:12","modified_gmt":"2020-05-15T13:23:12","slug":"internet-button-tutorial-post-slack","status":"publish","type":"post","link":"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/","title":{"rendered":"Internet Button: post to a Slack channel (tutorial #5)"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial5.jpg?resize=580%2C387\" alt=\"Internet-Button-Tutorial5\" width=\"580\" height=\"387\" class=\"aligncenter size-full wp-image-2799\" srcset=\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial5.jpg?w=984&amp;ssl=1 984w, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial5.jpg?resize=400%2C267&amp;ssl=1 400w, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial5.jpg?resize=768%2C512&amp;ssl=1 768w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/p>\n<h3>We&#8217;re going fullstack: Button > Led > Wifi > Slack<\/h3>\n<p><!--more--><\/p>\n<p>Particle released a C++ library that handles much of the interaction with the Internet Button hardware components. That lib is publicly available on <a href=\"https:\/\/github.com\/spark\/InternetButton\">GitHub<\/a> and includes a bunch of <a href=\"https:\/\/github.com\/spark\/InternetButton\/tree\/master\/firmware\/examples\">useful examples<\/a>.<\/p>\n<p>First you need to include that library:<\/p>\n<ol>\n<li>Go to Particle <a href=\"https:\/\/github.com\/spark\/InternetButton\/tree\/master\/firmware\">GitHub<\/a>.<\/li>\n<li>Download <code>InternetButton.cpp<\/code> and <code>InternetButton.h<\/code> files.<\/li>\n<li>Move them to a folder on your project&#8217;s repo (I used a <code>libs<\/code> folder).<\/li>\n<li>Add at the top of your <code>.ino<\/code> file this line <code>#include \"InternetButton.h\"<\/code>.<\/li>\n<\/ol>\n<p><strong>Say you want to configure one of your buttons to publish a message on a Slack channel on every press<\/strong>. For that you will have to play with webhooks or webapps. <a href=\"https:\/\/github.com\/llauren\">Robin Laur\u00e9n<\/a> released a <a href=\"https:\/\/github.com\/llauren\/slackbutton#how-to-do-it\">precious tutorial<\/a> on how to do it.<\/p>\n<h3>All together now<\/h3>\n<p>To finish this <a href=\"http:\/\/www.diogonunes.com\/blog\/tag\/hardware\/\">series<\/a>, I decided to use a bit of every tutorial so far. This is the flow we are about to implement:<\/p>\n<ul>\n<li>Someone presses the 3rd button<\/li>\n<li>LEDs light up in a circular pattern<\/li>\n<li>Using wifi, a Slack webhook is called<\/li>\n<li>A message is published on a Slack channel<\/li>\n<li>All LEDs blink green to display success<\/li>\n<\/ul>\n<p>Below are code examples that implement each of those features. Although I added extra comment lines, these are just snippets. You may need additional code to make them work.<\/p>\n<h4>Pressing the button<\/h4>\n<pre><code>  \/\/ when the 3rd button (6 o'clock) is pressed\n  if (b.buttonOn(3)) {\n\n    b.ledOn(6, 255, 255, 255); \/\/ visual feedback of button press\n    ledsDisplayWait(6);        \/\/ fancy light show\n\n    \/\/ Get a message and send it to Slack\n    String message = SlackHelper::getMessage();\n    SlackHelper::publishMessage(message);\n\n    ledsBlinkSuccess();        \/\/ visual feedback of success\n  }\n<\/code><\/pre>\n<h4>Helper: light show<\/h4>\n<pre><code>int BLINK_TIMEOUT = 500; \/\/milliseconds \n\n\/\/ Lights up LEDs in a circular pattern, starting somewhere\nvoid ledsDisplayWait(int ledToLight = 1) {\n  for (int i = 1; i &lt;= 12; i++)\n  {\n    b.ledOn(ledToLight, 0, 0, 255);\n    ledToLight = (ledToLight % 12) + 1;\n    delay(100);\n  }\n  b.allLedsOff();\n}\n\n\/\/ Blink all LEDs green\nvoid ledsBlinkSuccess() {\n  b.allLedsOn(0, 255, 0);\n  delay(BLINK_TIMEOUT);\n  b.allLedsOff();\n}\n<\/code><\/pre>\n<h4>Helper: get a random message<\/h4>\n<pre><code>  String SlackHelper::getMessage() {\n    \/* DISCLAIMER\n     * I know I should use an array of strings and get a rand string.\n     * Just you try to:\n     * 1. Use declare a vector with const strings;\n     * 2. Generate a random number based on current time;\n     * 3. Get an element from the vector at a specific index;\n     * 4. Convert that string to String (or is it String^)\n     * Good luck with that\n     *\/\n    int randIndex = rand() % 3 + 1;\n    switch (randIndex) {\n      case 1: return \"*Hello World!* :yum: (@here)\";\n      case 2: return \"*Ol\u00e1 Mundo!* :walking: (@here)\";\n      case 3: return \"*Bonjour le monde!* :laughing: (@here)\";\n    }\n  }\n<\/code><\/pre>\n<h4>Helper: push a message to Slack<\/h4>\n<pre><code>void SlackHelper::publishMessage(String message) {\n\/*\n * Spark.publish() is a build-in method.\n * Just give it a webhook name and a message.\n * It will take care of the rest.\n *\/\n  Spark.publish(\"event-name\", message, 60, PRIVATE);\n  Spark.publish(\"subscriber-name\", message, 60, PRIVATE);\n  Spark.publish(\"another-subscriber\", message, 60, PRIVATE);\n  Spark.publish(\"add-as-many-as-you-want\", message, 60, PRIVATE);\n}\n<\/code><\/pre>\n<hr \/>\n<h3>Slack integration using webhooks<\/h3>\n<p>That&#8217;s <em>almost<\/em> it. You are just lacking a bit of configuration. You see, that <code>Spark.publish()<\/code> is warning Particle&#8217;s cloud that an event has happened. The cloud does not know what to do with it.<\/p>\n<p>For the purpose of our example, we want the cloud to passthrough the message to Slack. That&#8217;s when webhooks come to the rescue.<\/p>\n<h4>Steps for the subscriber<\/h4>\n<p>Whoever wants to receive your event needs to create a Slack webhook or endpoint that you can call when the even is triggered on the Internet Button.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/subscriber1.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/subscriber1.png?resize=580%2C308\" alt=\"subscriber1\" width=\"580\" height=\"308\" class=\"aligncenter size-full wp-image-2779\" srcset=\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/subscriber1.png?w=628&amp;ssl=1 628w, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/subscriber1.png?resize=400%2C213&amp;ssl=1 400w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<ol>\n<li>Go to your Slack&#8217;s <strong>Incoming WebHooks<\/strong>.<\/li>\n<li>Click <strong>Add Configuration<\/strong>.<\/li>\n<li>Select the channel that should received the notifications and click <strong>Add<\/strong>.<\/li>\n<li>Send us the <strong>Webhook URL<\/strong>.<\/li>\n<li>Feel free to customize the <strong>Name<\/strong> and <strong>Icon<\/strong> of this integration.<\/li>\n<\/ol>\n<p><a href=\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/subscriber3.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/subscriber3.png?resize=580%2C332\" alt=\"subscriber3\" width=\"580\" height=\"332\" class=\"aligncenter size-full wp-image-2778\" srcset=\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/subscriber3.png?w=928&amp;ssl=1 928w, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/subscriber3.png?resize=400%2C229&amp;ssl=1 400w, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/subscriber3.png?resize=768%2C439&amp;ssl=1 768w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<h4>Steps for the publisher<\/h4>\n<p>This is a template for any <code>webhook.json<\/code> (I like to keep them in a folder, each with suggestive names):<\/p>\n<pre><code>{\n    \"event\": \"XXXXXXXX\",\n    \"url\": \"YYYYYYYY\",\n    \"requestType\": \"POST\",\n    \"json\": {\n        \"text\": \"{{SPARK_EVENT_VALUE}}\",\n        \"link_names\": \"1\"\n    },\n    \"deviceID\": \"ZZZZZZZZZ\"\n}\n<\/code><\/pre>\n<p>That files describes a <a href=\"https:\/\/docs.particle.io\/guide\/how-to-build-a-product\/web-app\/\">Particle&#8217;s webhook<\/a>:<\/p>\n<ul>\n<li>Replace the <code>XXX<\/code> with your desired and unique event name.<\/li>\n<li>Replace the <code>YYY<\/code> with the Slack&#8217;s webhook URL from the previous section.<\/li>\n<li>Replace the <code>ZZZ<\/code> with your device ID, even though this field is optional, it will ensure only your device can make calls to that webhook.<\/li>\n<li><code>{{SPARK_EVENT_VALUE}}<\/code> is a variable tag that will be replaced with the message from <code>Spark.publish()<\/code> method.<\/li>\n<li><code>\"link_names\": \"1\"<\/code> is specific to Slack&#8217;s API, it&#8217;s a workaround to let your bots use <code>@here<\/code> notifications.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Screen_Shot_2016-07-30_at_18.14.39.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Screen_Shot_2016-07-30_at_18.14.39.png?resize=542%2C410\" alt=\"Screen_Shot_2016-07-30_at_18.14.39\" width=\"542\" height=\"410\" class=\"aligncenter size-full wp-image-2777\" srcset=\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Screen_Shot_2016-07-30_at_18.14.39.png?w=542&amp;ssl=1 542w, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Screen_Shot_2016-07-30_at_18.14.39.png?resize=400%2C303&amp;ssl=1 400w\" sizes=\"auto, (max-width: 542px) 100vw, 542px\" \/><\/a><\/p>\n<p>Once you are done, open a terminal and run <code>particle webhook create &lt;name-of-webhook.json&gt;<\/code>. Then you can check online, on Particle&#8217;s cloud, that the webhook was created.<\/p>\n<h3>Mission accomplished<\/h3>\n<p>Sorry for the long and detailed tutorial. But hey, at least you know every action you have to take to make it work :P Good luck!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;re going fullstack: Button > Led > Wifi > Slack<\/p>\n","protected":false},"author":1,"featured_media":2799,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[29,63,64,31],"class_list":["post-2722","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech","tag-coding","tag-hardware","tag-internet-button","tag-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Internet Button: post to a Slack channel (tutorial #5) - The Geeky Gecko<\/title>\n<meta name=\"description\" content=\"In this Particle Internet Button tutorial we&#039;ll use everything we learned: buttons, leds and Slack integration! Save time with this guide and its examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Internet Button: post to a Slack channel (tutorial #5) - The Geeky Gecko\" \/>\n<meta property=\"og:description\" content=\"In this Particle Internet Button tutorial we&#039;ll use everything we learned: buttons, leds and Slack integration! Save time with this guide and its examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/\" \/>\n<meta property=\"og:site_name\" content=\"The Geeky Gecko\" \/>\n<meta property=\"article:published_time\" content=\"2017-04-24T08:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-15T13:23:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial5.jpg?fit=984%2C656&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"984\" \/>\n\t<meta property=\"og:image:height\" content=\"656\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Diogo Nunes\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dialexnunes\" \/>\n<meta name=\"twitter:site\" content=\"@dialexnunes\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Diogo Nunes\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/\"},\"author\":{\"name\":\"Diogo Nunes\",\"@id\":\"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/a6fa79b293f22912664654fcfbd2da0c\"},\"headline\":\"Internet Button: post to a Slack channel (tutorial #5)\",\"datePublished\":\"2017-04-24T08:00:00+00:00\",\"dateModified\":\"2020-05-15T13:23:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/\"},\"wordCount\":519,\"publisher\":{\"@id\":\"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/a6fa79b293f22912664654fcfbd2da0c\"},\"image\":{\"@id\":\"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial5.jpg?fit=984%2C656&ssl=1\",\"keywords\":[\"coding\",\"hardware\",\"internet button\",\"tutorial\"],\"articleSection\":[\"Technology\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/\",\"url\":\"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/\",\"name\":\"Internet Button: post to a Slack channel (tutorial #5) - The Geeky Gecko\",\"isPartOf\":{\"@id\":\"https:\/\/www.diogonunes.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial5.jpg?fit=984%2C656&ssl=1\",\"datePublished\":\"2017-04-24T08:00:00+00:00\",\"dateModified\":\"2020-05-15T13:23:12+00:00\",\"description\":\"In this Particle Internet Button tutorial we'll use everything we learned: buttons, leds and Slack integration! Save time with this guide and its examples.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial5.jpg?fit=984%2C656&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial5.jpg?fit=984%2C656&ssl=1\",\"width\":984,\"height\":656},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.diogonunes.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Internet Button: post to a Slack channel (tutorial #5)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.diogonunes.com\/blog\/#website\",\"url\":\"https:\/\/www.diogonunes.com\/blog\/\",\"name\":\"The Geeky Gecko\",\"description\":\"The Geeky Gecko\",\"publisher\":{\"@id\":\"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/a6fa79b293f22912664654fcfbd2da0c\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.diogonunes.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/a6fa79b293f22912664654fcfbd2da0c\",\"name\":\"Diogo Nunes\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2026\/04\/Geeky-Gecko-2026-v2.png?fit=799%2C799&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2026\/04\/Geeky-Gecko-2026-v2.png?fit=799%2C799&ssl=1\",\"width\":799,\"height\":799,\"caption\":\"Diogo Nunes\"},\"logo\":{\"@id\":\"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/www.diogonunes.com\",\"https:\/\/x.com\/dialexnunes\"],\"url\":\"https:\/\/www.diogonunes.com\/blog\/author\/diogo-nunes\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Internet Button: post to a Slack channel (tutorial #5) - The Geeky Gecko","description":"In this Particle Internet Button tutorial we'll use everything we learned: buttons, leds and Slack integration! Save time with this guide and its examples.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/","og_locale":"en_US","og_type":"article","og_title":"Internet Button: post to a Slack channel (tutorial #5) - The Geeky Gecko","og_description":"In this Particle Internet Button tutorial we'll use everything we learned: buttons, leds and Slack integration! Save time with this guide and its examples.","og_url":"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/","og_site_name":"The Geeky Gecko","article_published_time":"2017-04-24T08:00:00+00:00","article_modified_time":"2020-05-15T13:23:12+00:00","og_image":[{"width":984,"height":656,"url":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial5.jpg?fit=984%2C656&ssl=1","type":"image\/jpeg"}],"author":"Diogo Nunes","twitter_card":"summary_large_image","twitter_creator":"@dialexnunes","twitter_site":"@dialexnunes","twitter_misc":{"Written by":"Diogo Nunes","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/#article","isPartOf":{"@id":"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/"},"author":{"name":"Diogo Nunes","@id":"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/a6fa79b293f22912664654fcfbd2da0c"},"headline":"Internet Button: post to a Slack channel (tutorial #5)","datePublished":"2017-04-24T08:00:00+00:00","dateModified":"2020-05-15T13:23:12+00:00","mainEntityOfPage":{"@id":"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/"},"wordCount":519,"publisher":{"@id":"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/a6fa79b293f22912664654fcfbd2da0c"},"image":{"@id":"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial5.jpg?fit=984%2C656&ssl=1","keywords":["coding","hardware","internet button","tutorial"],"articleSection":["Technology"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/","url":"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/","name":"Internet Button: post to a Slack channel (tutorial #5) - The Geeky Gecko","isPartOf":{"@id":"https:\/\/www.diogonunes.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/#primaryimage"},"image":{"@id":"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial5.jpg?fit=984%2C656&ssl=1","datePublished":"2017-04-24T08:00:00+00:00","dateModified":"2020-05-15T13:23:12+00:00","description":"In this Particle Internet Button tutorial we'll use everything we learned: buttons, leds and Slack integration! Save time with this guide and its examples.","breadcrumb":{"@id":"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/#primaryimage","url":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial5.jpg?fit=984%2C656&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial5.jpg?fit=984%2C656&ssl=1","width":984,"height":656},{"@type":"BreadcrumbList","@id":"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-post-slack\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.diogonunes.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Internet Button: post to a Slack channel (tutorial #5)"}]},{"@type":"WebSite","@id":"https:\/\/www.diogonunes.com\/blog\/#website","url":"https:\/\/www.diogonunes.com\/blog\/","name":"The Geeky Gecko","description":"The Geeky Gecko","publisher":{"@id":"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/a6fa79b293f22912664654fcfbd2da0c"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.diogonunes.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/a6fa79b293f22912664654fcfbd2da0c","name":"Diogo Nunes","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2026\/04\/Geeky-Gecko-2026-v2.png?fit=799%2C799&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2026\/04\/Geeky-Gecko-2026-v2.png?fit=799%2C799&ssl=1","width":799,"height":799,"caption":"Diogo Nunes"},"logo":{"@id":"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/www.diogonunes.com","https:\/\/x.com\/dialexnunes"],"url":"https:\/\/www.diogonunes.com\/blog\/author\/diogo-nunes\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial5.jpg?fit=984%2C656&ssl=1","jetpack-related-posts":[{"id":2718,"url":"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-click-button\/","url_meta":{"origin":2722,"position":0},"title":"Internet Button: push my buttons (tutorial #3)","author":"Diogo Nunes","date":"27 February, 2017","format":false,"excerpt":"Assign a different action to each button. Particle released a C++ library that handles much of the interaction with the Internet Button hardware components. That lib is publicly available on GitHub and includes a bunch of useful examples. To check if a button was pressed becomes as easy as buttonOn(led_number).\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.diogonunes.com\/blog\/category\/tech\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial3.jpg?fit=984%2C656&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial3.jpg?fit=984%2C656&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial3.jpg?fit=984%2C656&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial3.jpg?fit=984%2C656&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":2717,"url":"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-led-light\/","url_meta":{"origin":2722,"position":1},"title":"Internet Button: let there be light (tutorial #2)","author":"Diogo Nunes","date":"30 January, 2017","format":false,"excerpt":"Turning leds on and displaying light patterns. You can use Particle's mobile app to light the small built-in led on Photon (the chip). There's a guide here. It actually worked and the led turned blue. But we have an Internet Button with 11 large and bright LEDs. Those are the\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.diogonunes.com\/blog\/category\/tech\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial2.jpg?fit=984%2C656&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial2.jpg?fit=984%2C656&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial2.jpg?fit=984%2C656&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial2.jpg?fit=984%2C656&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":2702,"url":"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-ide-atom-github\/","url_meta":{"origin":2722,"position":2},"title":"Internet Button: Web IDE, Atom, GitHub (tutorial #1)","author":"Diogo Nunes","date":"2 January, 2017","format":false,"excerpt":"First things first. Now that you can connect to your Photon, it's time to give it some intelligence - time to get coding! To manage that code let's create a git repo. GitHub The official documentation recommends that you fork their InternetButton repo. You don't have to, but it helps\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.diogonunes.com\/blog\/category\/tech\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial1.jpg?fit=984%2C656&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial1.jpg?fit=984%2C656&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial1.jpg?fit=984%2C656&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial1.jpg?fit=984%2C656&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":2716,"url":"https:\/\/www.diogonunes.com\/blog\/internet-button-tutorial-sound-nyan-cat\/","url_meta":{"origin":2722,"position":3},"title":"Internet Button: it even has a speaker! (tutorial #4)","author":"Diogo Nunes","date":"27 March, 2017","format":false,"excerpt":"Now you can listen to Nyan Cat on demand. Particle released a C++ library that handles much of the interaction with the Internet Button hardware components. That lib is publicly available on GitHub and includes a bunch of useful examples. First you need to include that library: Go to Particle\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.diogonunes.com\/blog\/category\/tech\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial4.jpg?fit=984%2C656&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial4.jpg?fit=984%2C656&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial4.jpg?fit=984%2C656&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/Internet-Button-Tutorial4.jpg?fit=984%2C656&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":2687,"url":"https:\/\/www.diogonunes.com\/blog\/internet-button-unboxing-first-steps\/","url_meta":{"origin":2722,"position":4},"title":"Internet Button: unboxing and first steps","author":"Diogo Nunes","date":"5 December, 2016","format":false,"excerpt":"Brace yourself, it's going to be a bumpy ride. This is hardware and on top of that it runs on C++. I knew it would be painful. But that was the challenge. If you're new to Particle's Internet Button you might want to check this overview. Summarizing it: Particle is\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.diogonunes.com\/blog\/category\/tech\/"},"img":{"alt_text":"internet button particle","src":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/07\/IMG_20160614_140426195.jpg?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/07\/IMG_20160614_140426195.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/07\/IMG_20160614_140426195.jpg?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/07\/IMG_20160614_140426195.jpg?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/07\/IMG_20160614_140426195.jpg?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":2724,"url":"https:\/\/www.diogonunes.com\/blog\/particle-internet-button-overview\/","url_meta":{"origin":2722,"position":5},"title":"Internet Button by Particle: an overview","author":"Diogo Nunes","date":"26 September, 2016","format":false,"excerpt":"What it is The Internet Button contains a lot of useful hardware in a quite compact package. This is what it includes: Photon (the brain) with wifi access 11 bright RGB LEDs 4 physical buttons Sound speaker Accelerometer Plastic cover USB cable Particle's swag sticker :) How it works While\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.diogonunes.com\/blog\/category\/tech\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/internetbuttondiagram-1.jpg?fit=1102%2C735&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/internetbuttondiagram-1.jpg?fit=1102%2C735&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/internetbuttondiagram-1.jpg?fit=1102%2C735&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/internetbuttondiagram-1.jpg?fit=1102%2C735&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2016\/08\/internetbuttondiagram-1.jpg?fit=1102%2C735&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/posts\/2722","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/comments?post=2722"}],"version-history":[{"count":1,"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/posts\/2722\/revisions"}],"predecessor-version":[{"id":3780,"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/posts\/2722\/revisions\/3780"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/media\/2799"}],"wp:attachment":[{"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/media?parent=2722"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/categories?post=2722"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/tags?post=2722"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}