<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:clearspace="http://www.jivesoftware.com/xmlns/jive/rss" version="2.0">
  <channel>
    <title>Upcycle It</title>
    <link>https://www.element14.com/community/community/design-challenges/upcycleit/blog</link>
    <description>Upcycle It</description>
    <pubDate>Fri, 30 Jun 2017 08:00:44 GMT</pubDate>
    <generator>Jive Engage 8.0.5.0  (http://jivesoftware.com/products/)</generator>
    <dc:date>2017-06-30T08:00:44Z</dc:date>
    <item>
      <title>[Upcycle It] Interactive Race Car Driver - What next?</title>
      <link>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/29/upcycle-it-interactive-race-car-driver-what-next</link>
      <description>&lt;!-- [DocumentBodyStart:19698872-1f0f-4dbb-b648-8083cd3aa8ae] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;Despite a lack of posts there's actually been quite a bit going on over the last couple of weeks. Now that the challenge is over, I've been reviewing car and electronics.&lt;/p&gt;&lt;h2&gt;&lt;/h2&gt;&lt;h2&gt;Electronics&lt;/h2&gt;&lt;p&gt;There's been a few recurrent problems with the solution mostly around the fragile wiring and power issues. The subsystems have all been tested and checked over the last couple of weeks in an attempt to get a better demo video. It's quite a complex design with multiple batteries, power convertors, grove connector breakout boards and level shifters. The results is that I've not actually had driver and car working at the same time from battery.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Many of the design features were only there for the benefits of the challenge. Now that those restrictions have been lifted I will simplify the electronics and wiring.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;h2&gt;Car&lt;/h2&gt;&lt;p&gt;The wooden parts of the car will be dropped and I'll be printing replacements. The single extruder replacement heads for the Cel Robox are quite expensive and also no-one seems to have them in stock. So I'm saving up and looking around for suppliers.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;The car is a little back heavy and rather tall. This does mean that it likes to pull wheelies which is kind of cool but probably not good for the driver. So the battery will be moving to the middle of the car and electronics lowered.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;h2&gt;Software&lt;/h2&gt;&lt;p&gt;I've also been working through the software getting it all working together, I had trouble with DNS and security but resolved all that, last week. &lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FWorkshopshed%2FUpcyclingDesignChallenge" rel="nofollow" target="_blank"&gt;https://github.com/Workshopshed/UpcyclingDesignChallenge&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25778-429359/Screenshot_Connected.png"&gt;&lt;img alt="Screenshot_Connected.png" class="image-3 jive-image" height="900" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25778-429359/506-900/Screenshot_Connected.png" style="width: 360px; height: 640px;" width="506"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The web page for driving the car is really just there to test things. What I would really like to have is a UI that my daughter can use to learn basic programming concepts. I've been looking at various things and &lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fdevelopers.google.com%2Fblockly%2F" rel="nofollow" target="_blank"&gt;&lt;span style="color: #0066cc; text-decoration: underline;"&gt;Blockly&lt;/span&gt;&lt;/a&gt; looks good, it's open source, multi-platform and is easily customised. Blockly basically allows you to drag blogs onto a design area and when you run the code it compiles those into a language of your choice such as JavaScript. It's possible to create custom blocks with code which would send the same messages to MQTT as I currently do with my buttons. I can customise and add to the UI as she and the car evolve.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25778-429356/Blockly.png"&gt;&lt;img alt="Blockly.png" class="image-2 jive-image" height="558" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25778-429356/Blockly.png" style="width: 620px; height: 516px;" width="671"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;So this not the last of the interactive race car driver, there will be more to come.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:19698872-1f0f-4dbb-b648-8083cd3aa8ae] --&gt;</description>
      <pubDate>Thu, 29 Jun 2017 21:27:53 GMT</pubDate>
      <author>messages@element14.com</author>
      <guid>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/29/upcycle-it-interactive-race-car-driver-what-next</guid>
      <dc:date>2017-06-29T21:27:53Z</dc:date>
      <clearspace:dateToText>2 weeks 3 days ago</clearspace:dateToText>
      <clearspace:replyCount>7</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
      <wfw:comment>https://www.element14.com/community/community/design-challenges/upcycleit/blog/comment/upcycle-it-interactive-race-car-driver-what-next</wfw:comment>
      <wfw:commentRss>https://www.element14.com/community/community/design-challenges/upcycleit/blog/feeds/comments?blogPost=25778</wfw:commentRss>
    </item>
    <item>
      <title>Interview | Carmelito Andrade, Creator of the Upcycled Clock</title>
      <link>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/28/interview-carmelito-andrade-creator-of-the-upcycled-clock</link>
      <description>&lt;!-- [DocumentBodyStart:d6606f77-1e7e-4c72-be4f-c5e9ff658dbf] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;em&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25767-428517/upcycleITlogo.png"&gt;&lt;img alt="upcycleITlogo.png" class="image-1 jive-image" height="73" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25767-428517/upcycleITlogo.png" style="height: auto; float: left;" width="220"/&gt;&lt;/a&gt;We invited engineers, DIY hobbyists, and tinkerers to upcycle an obsolete item, computer, piece of electronic equipment, or appliance and make a cool new electronics project built around the &lt;a class="jive-link-wiki-small" data-containerId="2724" data-containerType="14" data-objectId="83882" data-objectType="102" href="https://www.element14.com/community/docs/DOC-83882/l/upcycle-it-design-challenge-the-kit"&gt;Intel&amp;#174; Edison Kit for Arduino&lt;/a&gt;. element14 member Carmelito Andrade took an old clock given to him by his mother and turned it into an intelligent home device that can give him the weather, traffic, updates on his email and Twitter accounts, and much more. His outstanding Upcycled Clock was selected as the winner of the &lt;a class="jivecontainerTT-hover-container jive-link-community-small" data-containerId="2549" data-containerType="14" data-objectId="2724" data-objectType="14" href="https://www.element14.com/community/community/design-challenges/upcycleit"&gt;Design Challenge&lt;/a&gt;, and I reached out to him with some questions about the project.&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25767-428509/sidebySide.png"&gt;&lt;img alt="sidebySide.png" height="283" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25767-428509/686-283/sidebySide.png" style="float: left;  width: 686.249px;" width="686"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: How did you decide on the clock as your device to upcycle? It seems like it has some sentimental value for you, was that part of your decision?&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Carmelito: With analog wrist watches now moving towards smartwatches, when I first heard about the Upcycle It Design Challenge on &lt;a class="jivecontainerTT-hover-container jive-link-community-small" data-containerId="2143" data-containerType="14" data-objectId="2224" data-objectType="14" href="https://www.element14.com/community/community/experts/benheck"&gt;The Ben Heck Show&lt;/a&gt;, and saw a boombox being upcycled, a few ideas crossed my mind. So I thought, "Why not upcycle my mom&amp;#8217;s old clock to make it smart?" Obviously, I only did it after getting her permission.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: Did you run into any unexpected challenges in assembling the clock, and how did you go about solving them?&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Carmelito: Ah yes, I think I ran into a lot of challenges! Here are a couple that bothered me the most:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;1) Deciding on the LED strip - when I first started I had planned to use NeoPixel (WS2812), which was one of the most important parts of the build for the LED diffusion panels, but reading a couple of posts on the Intel forums and searching the web for a possible solution, I decided to buy an APA102 LED strip, which already had a library and sample code on Intel's UPM github repository.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;2) I had a nozzle jam on my 3D printer multiple times, because I was printing with wood filament.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;div class="e14-video-container" style="max-width: 440px"&gt;&lt;div class="e14-video"&gt;&lt;iframe allowfullscreen="allowfullscreen" frameborder="0" height="330" scrolling="no" src="https://www.youtube.com/embed/ppi0lswSZAk?wmode=transparent" width="440"&gt;
&lt;/iframe&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: You posted an introduction for the clock laying out what features you intended to add; did any of the features you ultimately wound up adding come from some inspiration you had over the course of the Design Challenge?&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Carmelito: Yes, there were quite a few features that I did not plan for originally, but I thought would be good additions. For example:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;1) I live in Los Angeles, California, and the traffic is pretty bad out here. I think it's in the top 10 cities in the world for the worst traffic, in fact. So, the idea I had was to implement something which would give me the estimated travel time to get to work. To achieve this, I used the Google Maps distance matrix API. But, frankly, most days I see the traffic panel light up orange (which means a medium amount of traffic), although that's better than a few weeks back when it was all red, which I am guessing was because schools had vacations.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;2) For the alarm feature, to show data on the LCD, I was not planning to add the button and potentiometer originally to the panel, but after a couple of comments by Mark Beckett (username: mcb1) on my intro blog, I decided to sort this out. And while I was waiting for my package I had the button and POT panel sorted out.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;3) The LED strip I added at the back of the clock was also something that was not planned. Here the idea was to show critical things on the LED strip, for example, if it's raining then have the strip light up blue. I still need to improve this feature, and a couple of my friends suggested that I should connect a mic input/sensor and use it like a VU meter when I have music playing at home.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;4) I also made it possible to turn on and off the HUE lights at home from the clock. Though I rarely use this feature, the idea here is that you can turn on and off all of your Philips HUE lights at home using an IFTTT recipe.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;div class="e14-video-container" style="max-width: 440px"&gt;&lt;div class="e14-video"&gt;&lt;iframe allowfullscreen="allowfullscreen" frameborder="0" height="330" scrolling="no" src="https://www.youtube.com/embed/0ldL9wXaqvA?wmode=transparent" width="440"&gt;
&lt;/iframe&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: Are there any future capabilities you&amp;#8217;d like to add to the upcycled clock?&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Carmelito: Yes, there are two features in particular that I have wanted to add:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;1) Make the clock speak as soon as I get back home in the evening, which I partly added in a &lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25683" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/14/upcycled-clock-detect-door-opening"&gt;blog post&lt;/a&gt; after the challenge ended. But in addition to reading the weather and tweets, I also want the clock to read out the top 5 news headlines. For this I still need to figure out if I can use an RSS feed to download those headlines.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;2) Make it trigger my air conditioner when I get back in the evening if the temperature is above a certain threshold, maybe above 23C degrees, since I live in an old apartment building which has air conditioning units mounted on its walls. I need another ESP8266, which I plan to connect to a power tail switch to trigger switching on the air conditioner, and then switching it off if the temperature gets below around 20C.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: You seem to have drawn on a number of different skills in constructing your clock; in what discipline do you feel you most improved over the course of the challenge?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25767-428516/IMG_20170517_190136.jpg"&gt;&lt;img alt="IMG_20170517_190136.jpg" height="436" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25767-428516/502-436/IMG_20170517_190136.jpg" style="float: right;" width="502"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Carmelito: I would say the skill I most improved was using Autodesk Fusion 360 to design and 3D print. And I would also like to mention that I am happy with how the replacement panels on the clock turned out, and I'm glad that my mother found the clock interesting and liked the overall aesthetic when I demonstrated the features to her via video chat.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;In addition, it was interesting to see most of my fellow challengers using node.js in their Design Challenge entries, and this has motivated me to learn node.js.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Check out the rest of the entries for the &lt;a class="jivecontainerTT-hover-container jive-link-community-small" data-containerId="2549" data-containerType="14" data-objectId="2724" data-objectType="14" href="https://www.element14.com/community/community/design-challenges/upcycleit"&gt;Upcycle It Design Challenge!&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:d6606f77-1e7e-4c72-be4f-c5e9ff658dbf] --&gt;</description>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">intel</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">edison</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">intel edison</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">design challenges</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycle_it</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycle it</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">design competition</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycle it design challenge</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">intel upcycle it design challenge</category>
      <pubDate>Wed, 28 Jun 2017 19:22:37 GMT</pubDate>
      <author>messages@element14.com</author>
      <guid>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/28/interview-carmelito-andrade-creator-of-the-upcycled-clock</guid>
      <dc:date>2017-06-28T19:22:37Z</dc:date>
      <clearspace:dateToText>2 weeks 5 days ago</clearspace:dateToText>
      <clearspace:replyCount>4</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
      <wfw:comment>https://www.element14.com/community/community/design-challenges/upcycleit/blog/comment/interview-carmelito-andrade-creator-of-the-upcycled-clock</wfw:comment>
      <wfw:commentRss>https://www.element14.com/community/community/design-challenges/upcycleit/blog/feeds/comments?blogPost=25767</wfw:commentRss>
    </item>
    <item>
      <title>Final Blog for Team_fastcar (Which apparently was not submitted)</title>
      <link>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/22/final-blog-for-teamfastcar-which-apparently-was-not-submitted</link>
      <description>&lt;!-- [DocumentBodyStart:4566c2f1-5cbb-4529-8468-0efacfdd7219] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p dir="ltr" style="text-indent: 36pt;"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;Firstly, we would like to apologize for turning in our final blog late. Personal schedule conflicts and time management issues lead us to complete the project at a slower pace than anticipated. Our project&amp;#8217;s latency was also in part caused the fact that we did not receive our Edison kit, which pressed us for time when it came to completing the clock&amp;#8217;s systems that relied on use of the Edison. Nevertheless, we learned a lot about the Edison chip while making an attempt to create our own clock. Overall, we greatly enjoyed the experience of being able to participate in this competition. If we can work together again, I would hope that we would be able to connect the buttons we made to the Raspberry pi for audio/recording control rather than having to connect it to a computer. In addition, we would probably have used interrupts to make it so the clock hand doesn't just go around in circles to reset.&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;This is how we connected the stepper motor to the calibration pin with set screw couplers. It can reliably turn the pin when secured to the back half of the clock.&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&lt;a href="https://lh5.googleusercontent.com/gY26rx_RfP88BgljtxRztpCKIEloKj-WPLoiDmabzxlh-gieeyPB3BuW_nXiaA5M8k5eQsW4yIPtxaFozDq22ziY_Zes7MyGqmolCdE-95_p2k-huVkrkc7x2PWp3ZSLbXg3FCuk"&gt;&lt;img alt="803115264_15167836755171351300.jpg" class="jive-image" height="512" src="https://lh5.googleusercontent.com/gY26rx_RfP88BgljtxRztpCKIEloKj-WPLoiDmabzxlh-gieeyPB3BuW_nXiaA5M8k5eQsW4yIPtxaFozDq22ziY_Zes7MyGqmolCdE-95_p2k-huVkrkc7x2PWp3ZSLbXg3FCuk" style="border-style: none;" width="378"/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000; font-weight: bold;"&gt;Final Arduino Code: &lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;#include &amp;lt;Dhcp.h&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;#include &amp;lt;Dns.h&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;#include &amp;lt;WiFi.h&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;#include &amp;lt;WiFiClient.h&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;#include &amp;lt;WiFiServer.h&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;#include &amp;lt;WiFiUdp.h&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;#include &amp;lt;Stepper.h&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;#include &amp;lt;Stepper.h&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;const int stepsPerRevolution=60;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;#include &amp;lt;SPI.h&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;// create an instance of the stepper class, specifying&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;// the number of steps of the motor and the pins it's&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;// attached to&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;Stepper mystepper(stepsPerRevolution, 5, 4, 3, 2);&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;int stepCount=0;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;// the previous reading from the analog input&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;int status = WL_IDLE_STATUS;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;char ssid[] = "SSID";&amp;#160; //&amp;#160; network SSID&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;char pass[] = "Passcode";&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // network password&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;unsigned int localPort = 2390;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // local port to listen for UDP packets&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;IPAddress timeServer(129, 6, 15, 28); // time.nist.gov NTP server&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;const int NTP_PACKET_SIZE = 48; // NTP time stamp is in the first 48 bytes of the message&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;byte packetBuffer[ NTP_PACKET_SIZE]; //buffer to hold incoming and outgoing packets&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;// A UDP instance to let us send and receive packets over UDP&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;WiFiUDP Udp;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;void setup() {&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; // Open serial communications and wait for port to open:&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; Serial.begin(9600);&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; while (!Serial) {&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; ; // wait for serial port to connect. Needed for native USB port only&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; }&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; // check for the presence of the shield:&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; if (WiFi.status() == WL_NO_SHIELD) {&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; Serial.println("WiFi shield not present");&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; // don't continue:&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; while (true);&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; }&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; String fv = WiFi.firmwareVersion();&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; if (fv != "1.1.0") {&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; Serial.println("Please upgrade the firmware");&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; }&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; // attempt to connect to Wifi network:&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; while (status != WL_CONNECTED) {&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; Serial.print("Attempting to connect to SSID: ");&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; Serial.println(ssid);&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; // Connect to WPA/WPA2 network. Change this line if using open or WEP network:&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; status = WiFi.begin(ssid, pass);&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; // wait 10 seconds for connection:&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; delay(10000);&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; }&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; Serial.println("Connected to wifi");&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; printWifiStatus();&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; Serial.println("\nStarting connection to server...");&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; Udp.begin(localPort);&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;void loop() {&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;myStepper.setSpeed(motorSpeed);&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; // step 1/100 of a revolution:&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; myStepper.step(stepsPerRevolution / 100);&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160; delay(59000);&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160; if( digitalRead(0)==LOW &amp;amp;&amp;amp; digitalRead(1)==LOW)&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160; {&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; sendNTPpacket(timeServer); // send an NTP packet to a time server&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; // wait to see if a reply is available&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; delay(1000);&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; if (Udp.parsePacket()) {&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; Serial.println("packet received");&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; // We've received a packet, read the data from it&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; Udp.read(packetBuffer, NTP_PACKET_SIZE); // read the packet into the buffer&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; //the timestamp starts at byte 40 of the received packet and is four bytes,&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; // or two words, long. First, extract the two words:&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; unsigned long highWord = word(packetBuffer[40], packetBuffer[41]);&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]);&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; // combine the four bytes (two words) into a long integer&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; unsigned long secsSince1900 = highWord &amp;lt;&amp;lt; 16 | lowWord;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; unsigned long epoch = secsSince1900 - 2208988800UL;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; Serial.print("The UTC time is ");&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // UTC is the time at Greenwich Meridian (GMT)&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; Serial.print((epoch&amp;#160; % 86400L) / 3600);&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; // print the hour (86400 equals secs per day)&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; Serial.print(':');&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; if (((epoch % 3600) / 60) &amp;lt; 10) {&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // In the first 10 minutes of each hour, we'll want a leading '0'&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Serial.print('0');&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; Serial.print((epoch&amp;#160; % 3600) / 60); // print the minute (3600 equals secs per minute)&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; Serial.print(':');&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; if ((epoch % 60) &amp;lt; 10) {&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // In the first 10 seconds of each minute, we'll want a leading '0'&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Serial.print('0');&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; Serial.println(epoch % 60); // print the second&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; }&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;if((epoch%86400L/3600)==12&amp;amp;&amp;amp;((epoch&amp;#160; % 3600) / 60)==0){&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; while(digitalRead(0)==LOW &amp;amp;&amp;amp; digitalRead(1)==LOW)&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; {&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; myStepper.setSpeed(100);&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160;&amp;#160; myStepper.step(10);&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; }&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; &lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt; }&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; &lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160;&amp;#160; }&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; &lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;// send an NTP request to the time server at the given address&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;unsigned long sendNTPpacket(IPAddress&amp;amp; address) {&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; //Serial.println("1");&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; // set all bytes in the buffer to 0&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; memset(packetBuffer, 0, NTP_PACKET_SIZE);&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; // Initialize values needed to form NTP request&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; // (see URL above for details on the packets)&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; //Serial.println("2");&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; packetBuffer[0] = 0b11100011;&amp;#160;&amp;#160; // LI, Version, Mode&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; packetBuffer[1] = 0;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Stratum, or type of clock&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; packetBuffer[2] = 6;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Polling Interval&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; packetBuffer[3] = 0xEC;&amp;#160; // Peer Clock Precision&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; // 8 bytes of zero for Root Delay &amp;amp; Root Dispersion&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; packetBuffer[12]&amp;#160; = 49;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; packetBuffer[13]&amp;#160; = 0x4E;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; packetBuffer[14]&amp;#160; = 49;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; packetBuffer[15]&amp;#160; = 52;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; //Serial.println("3");&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; // all NTP fields have been given values, now&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; // you can send a packet requesting a timestamp:&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; Udp.beginPacket(address, 123); //NTP requests are to port 123&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; Udp.write(packetBuffer, NTP_PACKET_SIZE);&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;&amp;#160; Udp.endPacket();&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;Admittedly, the above code has a flaw where instead of calibrating, it merely waits until the conditions are met at midnight. There are pins connecting to the hour and minute hand that form a switch with the arduino (0 and 1 pins). &lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;Raspberry Pi &lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;We set up a system which requires one to be connected to a computer in order to use it&amp;hellip;. But it can record and playback audio. &lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;Arecord filename.wav -record function\&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;Hit ctrl-c to stop recording&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: #000000;"&gt;Mpv filename.wav to play the recorded audio &lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:4566c2f1-5cbb-4529-8468-0efacfdd7219] --&gt;</description>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycle_it</category>
      <pubDate>Thu, 22 Jun 2017 19:23:00 GMT</pubDate>
      <author>messages@element14.com</author>
      <guid>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/22/final-blog-for-teamfastcar-which-apparently-was-not-submitted</guid>
      <dc:date>2017-06-22T19:23:00Z</dc:date>
      <clearspace:dateToText>3 weeks 4 days ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
      <wfw:comment>https://www.element14.com/community/community/design-challenges/upcycleit/blog/comment/final-blog-for-teamfastcar-which-apparently-was-not-submitted</wfw:comment>
      <wfw:commentRss>https://www.element14.com/community/community/design-challenges/upcycleit/blog/feeds/comments?blogPost=25745</wfw:commentRss>
    </item>
    <item>
      <title>Upcycle It - Washing Machine Hydroponic Grower - #11 Planting</title>
      <link>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/21/upcycle-it-washing-machine-hydroponic-grower-12-summing-up</link>
      <description>&lt;!-- [DocumentBodyStart:edfc2cc1-7b4a-4b1c-a8bc-ec63f3b78a16] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;&lt;strong&gt;Preparing the growing baskets&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;The seeds are placed in a cut on the foam.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;I am testing Lettuce, Parsley, Rocket and Spinach all in one go.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25686-426301/IMG_20170527_202737827.jpg"&gt;&lt;img alt="IMG_20170527_202737827.jpg" class="image-1 jive-image" height="350" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25686-426301/197-350/IMG_20170527_202737827.jpg" style="width:197px; height: 350.477px;" width="197"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25686-426302/IMG_20170527_203951505.jpg"&gt;&lt;img alt="IMG_20170527_203951505.jpg" class="image-2 jive-image" height="900" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25686-426302/1600-900/IMG_20170527_203951505.jpg" style="width: 620px; height: 349px;" width="1600"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25686-426303/IMG_20170527_204128777.jpg"&gt;&lt;img alt="IMG_20170527_204128777.jpg" class="image-3 jive-image" height="352" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25686-426303/198-352/IMG_20170527_204128777.jpg" style="width: 198px; height: 352px;" width="198"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;So far this is what we got. I will place them in the drum as soon as I have most of them germinated.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25686-426300/IMG_20170612_153139136.jpg"&gt;&lt;img alt="IMG_20170612_153139136.jpg" class="image-4 jive-image" height="900" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25686-426300/1600-900/IMG_20170612_153139136.jpg" style="width: 620px; height: 349px;" width="1600"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;I will be using the following nutrient solution on the first cycle testing. They say this is the brand chosen by NASA and Antarctica Scientists to grow their experimental crops... Can't go wrong!&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25686-426548/floragro.jpg"&gt;&lt;img alt="floragro.jpg" class="image-5 jive-image" height="300" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25686-426548/floragro.jpg" style="height: auto;" width="365"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:edfc2cc1-7b4a-4b1c-a8bc-ec63f3b78a16] --&gt;</description>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">washing_machine</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">hydroponics</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">intel edison competition</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycle_it</category>
      <pubDate>Wed, 21 Jun 2017 04:43:17 GMT</pubDate>
      <author>messages@element14.com</author>
      <guid>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/21/upcycle-it-washing-machine-hydroponic-grower-12-summing-up</guid>
      <dc:date>2017-06-21T04:43:17Z</dc:date>
      <clearspace:dateToText>3 weeks 4 days ago</clearspace:dateToText>
      <clearspace:replyCount>7</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
      <wfw:comment>https://www.element14.com/community/community/design-challenges/upcycleit/blog/comment/upcycle-it-washing-machine-hydroponic-grower-12-summing-up</wfw:comment>
      <wfw:commentRss>https://www.element14.com/community/community/design-challenges/upcycleit/blog/feeds/comments?blogPost=25686</wfw:commentRss>
    </item>
    <item>
      <title>Upcycled Clock - Detect door opening (post challenge)</title>
      <link>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/14/upcycled-clock-detect-door-opening</link>
      <description>&lt;!-- [DocumentBodyStart:0df2c79e-186d-4897-bc92-2ee5383ca7df] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;As part of the this blog post, the idea is to implement something that would allow the clock to detect the opening of my front door in the evening, when I get back home from work, which then reads out the temperature, weather condition and tweets. After looking into my components box, I found two thing that would help me achieve this, that is an ESP8266 board and Magnetic contact switch aka a door sensor. Basically as part of the setup, I am using MQTT to publish a message from the ESP8266 when the door is opened, which is then received by the Intel Edison attached at the back of the clock , which then reads out the weather condition and tweets via a speaker connected to a USB soundcard. Here is a quick video demo of the setup -&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;div class="e14-video-container" style="max-width: 440px"&gt;&lt;div class="e14-video"&gt;&lt;iframe allowfullscreen="allowfullscreen" frameborder="0" height="330" scrolling="no" src="https://www.youtube.com/embed/0ldL9wXaqvA?wmode=transparent" width="440"&gt;
&lt;/iframe&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;As part of the circuit, I have a &lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fwww.adafruit.com%2Fproduct%2F375" rel="nofollow" target="_blank"&gt;Magnetic contact switch &lt;/a&gt;connected to pin#13, and I am also using the inbuilt LED on&amp;#160; pin#2 of the&lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Flearn.adafruit.com%2Fadafruit-huzzah-esp8266-breakout%2Foverview" rel="nofollow" target="_blank"&gt; Adafuit's Huzzah ESP8266&lt;/a&gt; breakout board, to light up when the door opens, this acts as an indicator for testing the setup.&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25683-422749/Circuit.jpg"&gt;&lt;img alt="Circuit.jpg" class="image-1 jive-image" height="900" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25683-422749/1486-900/Circuit.jpg" style="width: 620px; height: 376px;" width="1486"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Here is the Arduino code uploaded to ESP8266 breakout board. For more details on how to setup Arduino IDE for ESP8266, check out the guide at -&amp;#160; &lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Flearn.adafruit.com%2Fadafruit-huzzah-esp8266-breakout" rel="nofollow" target="_blank"&gt;https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;!--[CodeBlockStart:9da6e705-3348-4ae9-971e-8dd777876c9b][excluded]--&gt;&lt;pre class="c++" name="code"&gt;/*
 Create by Carmelito for the Upcycled Clock project to send an MQTT message from ESP8266 to the Intel Edison
 Date :06-08-2017
 For more details on setting up ESP8266 breakout board checkout -https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout 
*/

#include &amp;lt;ESP8266WiFi.h&amp;gt;
#include &amp;lt;PubSubClient.h&amp;gt;

// Update your WiFi router details below
const char* ssid = "xxxxxxxxxxxxx";
const char* password = "xxxxxxxxxxxxxx";
const char* mqtt_server = "test.mosquitto.org";


WiFiClient espClient;
PubSubClient client(espClient);
long lastMsg = 0; //time before last message was sent
char msg[50];
int value = 0;
int doorPin = 13; //Magnetic contact switch
int ledPin =2; //Blue Led on the ESP8266 Huzzah board

void setup_wifi() {
&amp;#160; delay(10);
&amp;#160; //connecting to a WiFi network
&amp;#160; Serial.println();
&amp;#160; Serial.print("Connecting to ");
&amp;#160; Serial.println(ssid);
&amp;#160; WiFi.begin(ssid, password);
&amp;#160; while (WiFi.status() != WL_CONNECTED) {
&amp;#160;&amp;#160;&amp;#160; delay(500);
&amp;#160;&amp;#160;&amp;#160; Serial.print(".");
&amp;#160; }
&amp;#160; randomSeed(micros());
&amp;#160; Serial.println("");
&amp;#160; Serial.println("WiFi connected");
&amp;#160; Serial.println("IP address: ");
&amp;#160; Serial.println(WiFi.localIP());
}

void callback(char* topic, byte* payload, unsigned int length) {
&amp;#160; Serial.print("Message arrived [");
&amp;#160; Serial.print(topic);
&amp;#160; Serial.print("] ");
&amp;#160; for (int i = 0; i &amp;lt; length; i++) {
&amp;#160;&amp;#160;&amp;#160; Serial.print((char)payload[i]);
&amp;#160; }
&amp;#160; Serial.println();
}

void reconnect() {
&amp;#160; // Loop until we're reconnected
&amp;#160; while (!client.connected()) {
&amp;#160;&amp;#160;&amp;#160; Serial.print("Attempting MQTT connection...");
&amp;#160;&amp;#160;&amp;#160; // Create a random client ID
&amp;#160;&amp;#160;&amp;#160; String clientId = "ESP8266Client-";
&amp;#160;&amp;#160;&amp;#160; clientId += String(random(0xffff), HEX);
&amp;#160;&amp;#160;&amp;#160; //Attempt to connect
&amp;#160;&amp;#160;&amp;#160; if (client.connect(clientId.c_str())) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Serial.println("connected");
&amp;#160;&amp;#160;&amp;#160; } else {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Serial.print("failed, rc=");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Serial.print(client.state());
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Serial.println(" try again in 5 seconds");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Wait 5 seconds before retrying
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; delay(5000);
&amp;#160;&amp;#160;&amp;#160; }
&amp;#160; }
}


void setup() {
&amp;#160; pinMode(ledPin, OUTPUT);
&amp;#160; pinMode(doorPin, INPUT_PULLUP);
&amp;#160; Serial.begin(115200); 
&amp;#160; setup_wifi();
&amp;#160; client.setServer(mqtt_server, 1883);
&amp;#160; client.setCallback(callback);
&amp;#160; digitalWrite(ledPin, LOW); 
}

void loop() {
&amp;#160; if (!client.connected()) {
&amp;#160;&amp;#160;&amp;#160; reconnect();
&amp;#160; }
&amp;#160; client.loop();


&amp;#160; long now = millis();
&amp;#160; if (now - lastMsg &amp;gt; 30000) { //30 seconds for between door opening and closing
&amp;#160;&amp;#160;&amp;#160; lastMsg = now;
&amp;#160;&amp;#160;&amp;#160; ++value;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if(digitalRead(13) == LOW) //door is open
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; digitalWrite(ledPin, HIGH); 
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Serial.println("Publish message: closed ");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; client.publish("door", "closed");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else //door is closed - disable the else section after testing is done.
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; digitalWrite(ledPin, LOW); 
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Serial.println("Publish message:open ");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; client.publish("door", "open");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 
&amp;#160; }
}
&lt;/pre&gt;&lt;!--[CodeBlockEnd:9da6e705-3348-4ae9-971e-8dd777876c9b]--&gt;&lt;div style="display:none;"&gt;&lt;/div&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;If you plan to run a test before the setting up the Intel Edison you can use chrome app called &lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fchrome.google.com%2Fwebstore%2Fdetail%2Fmqttlens%2Fhemojaaeigabkbcookmlgmdigohjobjm" rel="nofollow" target="_blank"&gt;MQTT Lens&lt;/a&gt; which you can download using the chrome web-store. Basically, as you see in the screenshot below, I have subscribed to a topic called &amp;#8211; door , which receives message every 30 seconds from the program above uploaded on the ESP8266.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25683-422963/MQTTlens.png"&gt;&lt;img alt="MQTTlens.png" class="image-2 jive-image" height="768" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25683-422963/MQTTlens.png" style="width: 620px; height: 349px;" width="1366"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;But as part of the final setup, a message will be received by the Edison only when the door is opened.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Now since the circuit needs to be mounted on door I 3D printed a case, which I can then nail just above the door as you see in the picture below.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;table border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid black;border: 1px solid #000000;padding: 2px;color: #ffffff;background-color: #6690bc;text-align: center;" valign="middle"&gt;&lt;strong&gt;{gallery} ESP8266&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #000000;padding: 2px;"&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25683-422964/3Dprint1.jpg"&gt;&lt;img alt="3Dprint1.jpg" class="image-3 jive-image" height="900" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25683-422964/1200-900/3Dprint1.jpg" style="width: 620px; height: 465px;" width="1200"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;3D print an enclosure&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #000000;padding: 2px;"&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25683-422965/ESP8266_close.JPG"&gt;&lt;img alt="ESP8266_close.JPG" class="image-4 jive-image" height="899" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25683-422965/1348-899/ESP8266_close.JPG" style="width: 620px; height: 414px;" width="1348"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;ESP8266 - Door Closed&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #000000;padding: 2px;"&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25683-422966/ESP8266_open.JPG"&gt;&lt;img alt="ESP8266_open.JPG" class="image-5 jive-image" height="899" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25683-422966/1348-899/ESP8266_open.JPG" style="width: 620px; height: 414px;" width="1348"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;ESP8266 - Door Open&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Now, to setup eSpeak on the Edison check out the blog post at - &lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25426" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/04/30/upcycled-clock-getting-the-weather-using-espeak"&gt;Upcycled Clock - Reading out the weather using eSpeak&lt;/a&gt;&lt;/p&gt;&lt;p&gt;And once you have completed the setup for eSpeak and OpenWeatherMap API using the link above , you will have to install paho-mqtt package using pip&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; $pip install paho-mqtt&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Once done, copy paste the python code below and run a quick test using MQTT lens to publish messages to the door topic&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25683-423301/Lens_EdisonSubscribe.png"&gt;&lt;img alt="Lens_EdisonSubscribe.png" class="image-6 jive-image" height="768" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25683-423301/Lens_EdisonSubscribe.png" style="width: 620px; height: 349px;" width="1366"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Here is the python code used for testing&lt;/p&gt;&lt;!--[CodeBlockStart:5146bb73-d0af-4dc0-ba29-2db2b0bd107a][excluded]--&gt;&lt;pre class="python" name="code"&gt;#Create for the Upcycle clock project using the Intel Edison -- test recive message from the ESP8266 connected to door on the topic- door
#Author : @CarmelitoA 06/09/2017
import paho.mqtt.client as mqtt

def on_connect(client, userdata, flags, rc):
&amp;#160;&amp;#160;&amp;#160; print("Connected to server. Connection code: "+str(rc))
&amp;#160;&amp;#160;&amp;#160; #subscribe to "door" topic
&amp;#160;&amp;#160;&amp;#160; client.subscribe("door")

def on_message(client, userdata, msg):
&amp;#160;&amp;#160; #print message on the topic,in this case door published from ESP8266
&amp;#160;&amp;#160;&amp;#160; #possible values msg.payload - connected, open and closed
&amp;#160;&amp;#160;&amp;#160; print("Topico: "+msg.topic+" -message recived: "+str(msg.payload))




client = mqtt.Client()
client.on_connect = on_connect&amp;#160;&amp;#160; 
client.on_message = on_message&amp;#160; 


client.connect("test.mosquitto.org", 1883, 60) 
client.loop_forever()
&lt;/pre&gt;&lt;!--[CodeBlockEnd:5146bb73-d0af-4dc0-ba29-2db2b0bd107a]--&gt;&lt;div style="display:none;"&gt;&lt;/div&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Once you have completed your testing, for the final setup download the folder from the github repo and create a systemd service on the Intel Edison - &lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FCJAndrade%2FUpcycled-Clock%2Ftree%2Fmaster%2FDoorMQTT" rel="nofollow" target="_blank"&gt;https://github.com/CJAndrade/Upcycled-Clock/tree/master/DoorMQTT&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:0df2c79e-186d-4897-bc92-2ee5383ca7df] --&gt;</description>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">iot</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">mqtt</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">esp8266</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">intel edison</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">3d printed</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycle it</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">3d print</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycledclock</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">mqtt_subscriber</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">mqtt_publisher</category>
      <pubDate>Wed, 14 Jun 2017 04:14:36 GMT</pubDate>
      <author>messages@element14.com</author>
      <guid>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/14/upcycled-clock-detect-door-opening</guid>
      <dc:date>2017-06-14T04:14:36Z</dc:date>
      <clearspace:dateToText>1 month 3 days ago</clearspace:dateToText>
      <clearspace:replyCount>3</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
      <wfw:comment>https://www.element14.com/community/community/design-challenges/upcycleit/blog/comment/upcycled-clock-detect-door-opening</wfw:comment>
      <wfw:commentRss>https://www.element14.com/community/community/design-challenges/upcycleit/blog/feeds/comments?blogPost=25683</wfw:commentRss>
    </item>
    <item>
      <title>Upcycle It - Washing Machine Hydroponic Grower - #12 Summing Up</title>
      <link>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/05/upcycle-it-washing-machine-hydroponic-grower-11-planting-and-testing</link>
      <description>&lt;!-- [DocumentBodyStart:4888ed55-2893-497a-9114-48d37df9fdce] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;&lt;strong&gt;The Challange&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a class="jivecontainerTT-hover-container jive-link-community-small" data-containerId="2549" data-containerType="14" data-objectId="2724" data-objectType="14" href="https://www.element14.com/community/community/design-challenges/upcycleit"&gt;Upcycle It&lt;/a&gt; &lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-family: Verdana, 'Verdana Ref', Geneva, Tahoma, sans-serif; font-size: 15px;"&gt;To upcycle&lt;/span&gt;&lt;span style="color: #333333; font-family: Verdana, 'Verdana Ref', Geneva, Tahoma, sans-serif; font-size: 15px;"&gt; an obsolete item, computer, piece of electronic equipment or appliance and make a cool new electronics project built around the Intel&amp;#174; Edison Kit for Arduino.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-family: Verdana, 'Verdana Ref', Geneva, Tahoma, sans-serif; font-size: 15px;"&gt;&lt;a href="https://files1.element14.com/community/themes/images/2017/upcycleITlogo.png"&gt;&lt;img alt="upcycleITlogo.png" class="image-2 jive-image" src="https://files1.element14.com/community/themes/images/2017/upcycleITlogo.png" style="height: auto;"/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-size: 15px; font-family: Verdana, 'Verdana Ref', Geneva, Tahoma, sans-serif;"&gt;&lt;strong&gt;Proposal&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25187" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/03/28/upcycle-it-washing-machine-into-a-rotary-hydroponic"&gt;Upcycle It - Washing Machine Hydroponic Grower - #1 Introduction&lt;/a&gt; &lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-family: Verdana, 'Verdana Ref', Geneva, Tahoma, sans-serif; font-size: 15px;"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: Arial; color: #333333;"&gt;To use an old front load washing machine to be the main assembly of the rotary hydroponic system controlled by the &lt;/span&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Verdana; color: #333333;"&gt;Intel&amp;#174; Edison Kit for Arduino.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-weight: inherit; font-size: 10pt; font-family: Verdana; font-style: inherit;"&gt;Controller to monitor temperature, humidity, nutrient solution PH and control grower light, drum motor and water pump. Values to be published and parameters to be adjusted remotely using MQTT protocol.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-weight: inherit; font-size: 10pt; font-family: Verdana; font-style: inherit;"&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426278/Edison+Upcycle.jpg"&gt;&lt;img alt="Edison+Upcycle.jpg" class="image-1 jive-image" height="374" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426278/406-374/Edison+Upcycle.jpg" style="width:406px; height: 373.913px;" width="406"/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="; color: #333333; font-size: 10pt; font-family: Verdana; font-style: inherit;"&gt;&lt;strong&gt;Washing Machine Modifications&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25242" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/04/03/upcycle-it-washing-machine-hydroponic-grower-2-preparation"&gt;Upcycle It - Washing Machine Hydroponic Grower - #2 Preparation&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25289" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/04/10/upcycle-it-washing-machine-hydroponic-grower-21-preparation"&gt;Upcycle It - Washing Machine Hydroponic Grower - #3 Preparation II&lt;/a&gt; &lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-weight: inherit; font-size: 10pt; font-family: Verdana; font-style: inherit;"&gt;Concrete ballast and some of the panels were removed. Also, most of the internal parts and wiring were stripped, leaving only the tumbler and the structure to hold it in place.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;a data-containerId="-1" data-containerType="-1" data-objectId="397126" data-objectType="111" href="/servlet/JiveServlet/downloadImage/38-25242-397126/IMG_20170401_181706834_HDR.jpg"&gt;&lt;img alt="IMG_20170401_181706834_HDR.jpg" class="image-6 jive-image" height="193" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426279/161-193/IMG_20170401_181706834_HDR.jpg" style="width:161px; height: 192.681px;" width="161"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426280/IMG-20170403-WA0009.jpg"&gt;&lt;img alt="IMG-20170403-WA0009.jpg" class="image-5 jive-image" height="196" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426280/261-196/IMG-20170403-WA0009.jpg" style="width:261px; height: 196.03px;" width="261"/&gt;&lt;/a&gt;&lt;span style="color: #333333; font-weight: inherit; font-size: 10pt; font-family: Verdana; font-style: inherit;"&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426281/IMG_20170408_181537639.jpg"&gt;&lt;img alt="IMG_20170408_181537639.jpg" class="image-3 jive-image" height="195" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426281/347-195/IMG_20170408_181537639.jpg" style="width:347px; height: 194.768px;" width="347"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426282/IMG_20170408_191921802.jpg"&gt;&lt;img alt="IMG_20170408_191921802.jpg" class="image-4 jive-image" height="197" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426282/111-197/IMG_20170408_191921802.jpg" style="width:111px; height: 197.397px;" width="111"/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="; color: #333333; font-size: 10pt; font-family: Verdana; font-style: inherit;"&gt;&lt;strong&gt;Grow Light Fitting&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25387" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/04/25/upcycle-it-washing-machine-hydroponic-grower-4-preparation-iii"&gt;Upcycle It - Washing Machine Hydroponic Grower - #4 Preparation III&lt;/a&gt; &lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-weight: inherit; font-size: 10pt; font-family: Verdana; font-style: inherit;"&gt;Upcycling also an old table lamp, the grow light fitting was mounted on a bracket off the drum. Having a flexible goose nose, i&lt;span style="color: #333333; font-family: Verdana, 'Verdana Ref', Geneva, Tahoma, sans-serif;"&gt;t can be easily bent away and returned to the position when loading and unloading the plants in the drum.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-weight: inherit; font-size: 10pt; font-family: Verdana, 'Verdana Ref', Geneva, Tahoma, sans-serif; font-style: inherit;"&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426283/IMG_20170425_143343842.jpg"&gt;&lt;img alt="IMG_20170425_143343842.jpg" class="image-7 jive-image" height="176" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426283/314-176/IMG_20170425_143343842.jpg" style="width:314px; height: 176.281px;" width="314"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426284/IMG_20170424_190258619.jpg"&gt;&lt;img alt="IMG_20170424_190258619.jpg" class="image-8 jive-image" height="175" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426284/98-175/IMG_20170424_190258619.jpg" style="width:98px; height: 174.884px;" width="98"/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-size: 10pt; font-family: Verdana, 'Verdana Ref', Geneva, Tahoma, sans-serif; font-style: inherit;"&gt;&lt;strong&gt;Stepper Motor&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-weight: inherit; font-size: 10pt; font-family: Verdana; font-style: inherit;"&gt;A printer stepper motor was mounted roughly at the same position where the original motor was so the original pulley and belt system was kept to turn the drum. The driver was mounted next to the stepper.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-weight: inherit; font-size: 10pt; font-family: Verdana; font-style: inherit;"&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426285/IMG_20170425_161318257.jpg"&gt;&lt;img alt="IMG_20170425_161318257.jpg" class="image-9 jive-image" height="253" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426285/142-253/IMG_20170425_161318257.jpg" style="width:142px; height: 253.027px;" width="142"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426286/IMG_20170425_164243740.jpg"&gt;&lt;img alt="IMG_20170425_164243740.jpg" class="image-10 jive-image" height="251" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426286/141-251/IMG_20170425_164243740.jpg" style="width:141px; height: 251.269px;" width="141"/&gt;&lt;/a&gt;&lt;/span&gt; &lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426287/IMG_20170604_191421800.jpg"&gt;&lt;img alt="IMG_20170604_191421800.jpg" class="image-11 jive-image" height="251" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426287/141-251/IMG_20170604_191421800.jpg" style="width:141px; height: 251.207px;" width="141"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-family: Verdana; font-size: 13.3333px;"&gt;&lt;strong&gt;Drum Modification&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-family: Verdana; font-size: 13.3333px;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25500" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/05/15/upcycle-it-washing-machine-hydroponic-grower-6-drum-modification"&gt;Upcycle It - Washing Machine Hydroponic Grower - #6 Drum Modification&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;We added spring loaded rails to secure hydroponic baskets in place once the drum starts spinning.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426288/IMG_20170512_182751175.jpg"&gt;&lt;img alt="IMG_20170512_182751175.jpg" class="image-14 jive-image" height="174" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426288/310-174/IMG_20170512_182751175.jpg" style="width:310px; height: 174.19px;" width="310"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426289/IMG_20170512_174505546.jpg"&gt;&lt;img alt="IMG_20170512_174505546.jpg" class="image-12 jive-image" height="349" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426289/196-349/IMG_20170512_174505546.jpg" style="width:196px; height: 348.521px;" width="196"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426290/IMG_20170512_182715968.jpg"&gt;&lt;img alt="IMG_20170512_182715968.jpg" class="image-13 jive-image" height="352" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426290/198-352/IMG_20170512_182715968.jpg" style="width:198px; height: 352.077px;" width="198"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-family: Verdana; font-size: 13.3333px;"&gt;&lt;strong&gt;Nutrient Solution System&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-family: Verdana; font-size: 13.3333px;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25563" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/05/upcycle-it-washing-machine-hydroponic-grower-8-water-system"&gt;Upcycle It - Washing Machine Hydroponic Grower - #8 Nutrient Solution System&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;A reservoir was placed under the drum so the nutrient solution can be pumped to keep the required level inside the drum.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-family: Verdana; font-size: 13.3333px;"&gt;&lt;strong&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426291/pastedImage_6.png"&gt;&lt;img alt="pastedImage_6.png" class="image-15 jive-image" height="254" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426291/263-254/pastedImage_6.png" style="width:263px; height: 253.931px;" width="263"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426292/IMG_20170528_192103448.jpg"&gt;&lt;img alt="IMG_20170528_192103448.jpg" class="image-16 jive-image" height="255" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426292/453-255/IMG_20170528_192103448.jpg" style="width:453px; height: 254.995px;" width="453"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426293/IMG_20170528_172817032.jpg"&gt;&lt;img alt="IMG_20170528_172817032.jpg" class="image-17 jive-image" height="256" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426293/144-256/IMG_20170528_172817032.jpg" style="width:144px; height: 255.948px;" width="144"/&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: verdana, geneva; font-size: 10pt;"&gt;&lt;strong&gt;Sensors and Interfacing&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-family: Verdana; font-size: 13.3333px;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25611" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/05/upcycle-it-washing-machine-hydroponic-grower-9-interfacing-edison-x-grower"&gt;Upcycle It - Washing Machine Hydroponic Grower - #9 Interfacing Edison X Grower&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-family: Verdana; font-size: 13.3333px;"&gt;Temperature/Humidity and Light sensors were fixed on the light mounting facing the inside of the drum. The PH probe was fixed on the return pipe so the probe is constantly submerged in the reservoir. The relays that switch the light and water pump were mounted inside a junction box.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-family: Verdana; font-size: 13.3333px;"&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426294/IMG_20170616_180755790.jpg"&gt;&lt;img alt="IMG_20170616_180755790.jpg" class="image-18 jive-image" height="279" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426294/157-279/IMG_20170616_180755790.jpg" style="width:157px; height: 279.111px;" width="157"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426295/IMG_20170530_175604798.jpg"&gt;&lt;img alt="IMG_20170530_175604798.jpg" class="image-19 jive-image" height="279" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426295/157-279/IMG_20170530_175604798.jpg" style="width:157px; height: 279.111px;" width="157"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426297/IMG_20170531_210116383.jpg"&gt;&lt;img alt="IMG_20170531_210116383.jpg" class="image-20 jive-image" height="280" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426297/498-280/IMG_20170531_210116383.jpg" style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 14px;" width="498"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426296/IMG_20170604_185439593.jpg"&gt;&lt;img alt="IMG_20170604_185439593.jpg" class="image-22 jive-image" height="280" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426296/498-280/IMG_20170604_185439593.jpg" style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 14px; width:498px; height: 279.913px;" width="498"/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Preparing the growing baskets&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25686" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/21/upcycle-it-washing-machine-hydroponic-grower-12-summing-up"&gt;Upcycle It - Washing Machine Hydroponic Grower - #11 Planting&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;The seeds are placed in a cut on the foam and left on a tray to germinate before going to the drum.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-419941/IMG_20170527_202737827.jpg"&gt;&lt;img alt="IMG_20170527_202737827.jpg" class="image-1 jive-image" height="350" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-419941/197-350/IMG_20170527_202737827.jpg" style="width:197px; height: 350.477px;" width="197"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426298/IMG_20170612_153139136.jpg"&gt;&lt;img alt="IMG_20170612_153139136.jpg" class="image-23 jive-image" height="247" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426298/439-247/IMG_20170612_153139136.jpg" style="width:439px; height: 247.115px;" width="439"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Testing the Rotary Growing System&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;This is the final apparency of the Rotary Growing System&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25635-426299/IMG_20170613_073234753_HDR.jpg"&gt;&lt;img alt="IMG_20170613_073234753_HDR.jpg" class="image-24 jive-image" height="450" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25635-426299/253-450/IMG_20170613_073234753_HDR.jpg" style="width: 253px; height: 450px;" width="253"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Below is a video of the starting of the rotary grower, showing the sensor values and status on the display.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span id="919c299c_5bc9_4cde_879a_7bb2e038558d"&gt;&lt;div class="e14-video-container" style="max-width: 520px;"&gt;&lt;div class="e14-video"&gt;&lt;iframe allowfullscreen="" data-htmlsrc="VideoPluginMacro" mozallowfullscreen="" src="//players.brightcove.net/1362235890001/NkxiVJdjx_default/index.html?videoId=5459275039001" webkitallowfullscreen=""&gt;
&lt;/iframe&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Unfortunately, I didn't have enough time to have the seeds germinating for the final post but I will keep posting photos and videos as it goes.&lt;/p&gt;&lt;p&gt;I also will add more functions on it such as a fan to refresh the air inside the drum, an air pump to aerate the solution and automate the solution PH control and nutrient feeding.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;I would like to thank Intel, element14, all community members that gave their suggestions and motivation, my friend Brent &lt;a class="jive-link-profile-small jiveTT-hover-user" data-containerId="-1" data-containerType="-1" data-objectId="496821" data-objectType="3" href="https://www.element14.com/community/people/bpapesh"&gt;bpapesh&lt;/a&gt; who gave a good hand on this project and my wife Camila (who hate electronics) for being so patience on the last weeks as I dedicated most of my free time to this project than to her.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:4888ed55-2893-497a-9114-48d37df9fdce] --&gt;</description>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">washing_machine</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">intel edison</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycle_it</category>
      <pubDate>Mon, 05 Jun 2017 00:43:21 GMT</pubDate>
      <author>messages@element14.com</author>
      <guid>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/05/upcycle-it-washing-machine-hydroponic-grower-11-planting-and-testing</guid>
      <dc:date>2017-06-05T00:43:21Z</dc:date>
      <clearspace:dateToText>3 weeks 11 hours ago</clearspace:dateToText>
      <clearspace:replyCount>8</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
      <wfw:comment>https://www.element14.com/community/community/design-challenges/upcycleit/blog/comment/upcycle-it-washing-machine-hydroponic-grower-11-planting-and-testing</wfw:comment>
      <wfw:commentRss>https://www.element14.com/community/community/design-challenges/upcycleit/blog/feeds/comments?blogPost=25635</wfw:commentRss>
    </item>
    <item>
      <title>Upcycle It - Washing Machine Hydroponic Grower - #10 Programming</title>
      <link>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/05/upcycle-it-washing-machine-hydroponic-grower-10-programming</link>
      <description>&lt;!-- [DocumentBodyStart:0435ecd1-6311-4a22-a62d-e0395ff2e878] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;We started assembling and flashing the board following Intel instructions at &lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fsoftware.intel.com%2Fen-us%2Fget-started-edison-windows" rel="nofollow" target="_blank"&gt;https://software.intel.com/en-us/get-started-edison-windows&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;As the idea is to get feeds from the rotary grower and be able to change settings such as drum rotation and grow light time on/off periods we have to run MQTT broker and client.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;At this stage, the broker will be only accessible on the local network but later I will set up a DNS server so we can access it from everywhere.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Building and Running Mosquitto* MQTT on the Intel&amp;#174; Edison board&lt;/p&gt;&lt;p&gt;There are some tips on how to install it on the link below; however, the current version is &lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=http%3A%2F%2Fmosquitto.org%2Ffiles%2Fsource%2Fmosquitto-1.4.12.tar.gz" rel="nofollow" target="_blank"&gt;mosquitto-1.4.12.tar.gz&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fsoftware.intel.com%2Fen-us%2Fblogs%2F2015%2F02%2F20%2Fbuilding-and-running-mosquitto-mqtt-on-intel-edison" rel="nofollow" target="_blank"&gt;https://software.intel.com/en-us/blogs/2015/02/20/building-and-running-mosquitto-mqtt-on-intel-edison&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;To have the sketch running from boot and initialize the mosquitto broker I used the script below&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;!--[CodeBlockStart:682fab47-f1a7-4a1c-8837-d964e253110c][excluded]--&gt;&lt;pre class="plain" name="code"&gt;#File: /etc/init.d# vi automateSketch.sh
exec /sketch/./sketch.elf foo bar &amp;amp;
 exec mosquitto -d

&lt;/pre&gt;&lt;!--[CodeBlockEnd:682fab47-f1a7-4a1c-8837-d964e253110c]--&gt;&lt;div style="display:none;"&gt;&lt;/div&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Make the script executable by changing the permissions with chmod&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;root@edison:/etc/init.d# chmod +x /etc/init.d/automateSketch.sh&lt;/p&gt;&lt;p&gt;root@edison:/etc/init.d# chmod +x automateSketch.sh&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;To have the script executed every time Linux boots&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;root@edison:/etc/init.d# update-rc.d automateSketch.sh defaults&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Below are the library files I used to have the MQTT running. I got those files from &lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fsoftware.intel.com%2Fen-us%2Fblogs%2F2015%2F04%2F06%2Fusing-edison-securely-connect-iot-sensor-to-the-internet-with-mqtt" rel="nofollow" target="_blank"&gt;https://software.intel.com/en-us/blogs/2015/04/06/using-edison-securely-connect-iot-sensor-to-the-internet-with-mqtt&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;pre class="jive_macro_code _jivemacro_uid_14965786302766646 jive_text_macro" data-renderedposition="134_8_1245_2752"&gt;&lt;p&gt;// File: MQTTClient.cpp&lt;/p&gt;&lt;p&gt;#include "MQTTClient.h"&lt;/p&gt;&lt;p&gt;#include &amp;lt;fcntl.h&amp;gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;/*======================================================================&lt;/p&gt;&lt;p&gt;&amp;#160; Constructor/Destructor&lt;/p&gt;&lt;p&gt;========================================================================*/&lt;/p&gt;&lt;p&gt;MQTTClient::MQTTClient()&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;MQTTClient::~MQTTClient()&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;#160; close();&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;void MQTTClient::close()&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;#160; if (spipe) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; fclose(spipe);&lt;/p&gt;&lt;p&gt;&amp;#160; }&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;/*========================================================================&lt;/p&gt;&lt;p&gt;&amp;#160; Initialization. Store variables to be used for subscribe/publish calls&lt;/p&gt;&lt;p&gt;==========================================================================*/&lt;/p&gt;&lt;p&gt;void MQTTClient::begin(char *broker, int port, security_mode smode, &lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; char* cafile, char *user, char *psk)&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;#160; strcpy(mqtt_broker, broker);&lt;/p&gt;&lt;p&gt;&amp;#160; serverPort = port;&lt;/p&gt;&lt;p&gt;&amp;#160; mode = smode;&lt;/p&gt;&lt;p&gt;&amp;#160; if (mode == SSL) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; strcpy(certificate_file, cafile);&lt;/p&gt;&lt;p&gt;&amp;#160; }&lt;/p&gt;&lt;p&gt;&amp;#160; else if (mode == PSK) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; strcpy(psk_identity, user);&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; strcpy(psk_password, psk);&lt;/p&gt;&lt;p&gt;&amp;#160; }&lt;/p&gt;&lt;p&gt;&amp;#160; Serial.println("MQTTClient initialized");&lt;/p&gt;&lt;p&gt;&amp;#160; Serial.print("Broker: "); Serial.println(mqtt_broker);&lt;/p&gt;&lt;p&gt;&amp;#160; Serial.print("Port:&amp;#160;&amp;#160; "); Serial.println(serverPort);&lt;/p&gt;&lt;p&gt;&amp;#160; Serial.print("Mode:&amp;#160;&amp;#160; "); Serial.println(mode);&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;/*=======================================================================&lt;/p&gt;&lt;p&gt;&amp;#160; Subscribe to a topic, (*callback) is a function to be called when client&lt;/p&gt;&lt;p&gt;&amp;#160; receive a message&lt;/p&gt;&lt;p&gt;=========================================================================*/&lt;/p&gt;&lt;p&gt;boolean MQTTClient::subscribe(char* topic, &lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; void (*callback)(char* topic, char* message))&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;#160; char cmdString[256];&lt;/p&gt;&lt;p&gt;&amp;#160; &lt;/p&gt;&lt;p&gt;&amp;#160; if (mqtt_broker == NULL) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; return false;&lt;/p&gt;&lt;p&gt;&amp;#160; }&lt;/p&gt;&lt;p&gt;&amp;#160; if (topic == NULL) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; return false;&lt;/p&gt;&lt;p&gt;&amp;#160; }&lt;/p&gt;&lt;p&gt;&amp;#160; &lt;/p&gt;&lt;p&gt;&amp;#160; callback_function = callback;&lt;/p&gt;&lt;p&gt;&amp;#160; switch(mode) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; case OPEN:&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sprintf(cmdString, &lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; "mosquitto_sub -h %s -p %d -t %s -v",&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mqtt_broker, serverPort, topic);&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; break;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; case SSL:&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sprintf(cmdString, &lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; "mosquitto_sub -h %s -p %d -t %s -v --cafile %s", &lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mqtt_broker, serverPort, topic, certificate_file);&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; break;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; case PSK:&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sprintf(cmdString, &lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; "mosquitto_sub -h %s -p %d -t %s -v --psk-identity %s --psk %s",&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mqtt_broker, serverPort, topic, psk_identity, psk_password);&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; break;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; default:&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; break;&lt;/p&gt;&lt;p&gt;&amp;#160; }&lt;/p&gt;&lt;p&gt;&amp;#160; if ((spipe = (FILE*)popen(cmdString, "r")) != NULL) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; // we need to set the pipe read mode to non-blocking&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; int fd&amp;#160;&amp;#160;&amp;#160; = fileno(spipe);&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; int flags = fcntl(fd, F_GETFL, 0);&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; flags |= O_NONBLOCK;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; fcntl(fd, F_SETFL, flags);&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; strcpy(topicString, topic);&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; return true;&lt;/p&gt;&lt;p&gt;&amp;#160; }&lt;/p&gt;&lt;p&gt;&amp;#160; else {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; return false;&lt;/p&gt;&lt;p&gt;&amp;#160; }&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;/*====================================================================&lt;/p&gt;&lt;p&gt;&amp;#160; Check if there is data in the pipe, &lt;/p&gt;&lt;p&gt;&amp;#160; if true, parse topic and message and execute callback function&lt;/p&gt;&lt;p&gt;&amp;#160; return if pipe is empty&lt;/p&gt;&lt;p&gt;======================================================================*/&lt;/p&gt;&lt;p&gt;boolean MQTTClient::loop()&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;#160; if (fgets(dataBuffer, sizeof(dataBuffer), spipe)) {&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; parseDataBuffer();&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; callback_function(topic, message);&lt;/p&gt;&lt;p&gt;&amp;#160; }&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;/*====================================================================&lt;/p&gt;&lt;p&gt;&amp;#160; Publish a message on the given topic&lt;/p&gt;&lt;p&gt;======================================================================*/&lt;/p&gt;&lt;p&gt;boolean MQTTClient::publish(char *topic, char *message)&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;#160; FILE*&amp;#160;&amp;#160; ppipe;&lt;/p&gt;&lt;p&gt;&amp;#160; char&amp;#160;&amp;#160;&amp;#160; cmdString[256];&lt;/p&gt;&lt;p&gt;&amp;#160; boolean retval = false;&lt;/p&gt;&lt;p&gt;&amp;#160; if (this-&amp;gt;mqtt_broker == NULL) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; return false;&lt;/p&gt;&lt;p&gt;&amp;#160; }&lt;/p&gt;&lt;p&gt;&amp;#160; if (topic == NULL) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; return false;&lt;/p&gt;&lt;p&gt;&amp;#160; }&lt;/p&gt;&lt;p&gt;&amp;#160; switch (this-&amp;gt;mode) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; case OPEN:&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sprintf(cmdString,&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; "mosquitto_pub -h %s -p %d -t %s -m \"%s\" %s",&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mqtt_broker, serverPort, topic, message, retain_flag?"-r":"");&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; break;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; case SSL:&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sprintf(cmdString,&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; "mosquitto_pub -h %s -p %d --cafile %s -t %s -m \"%s\" %s",&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mqtt_broker, serverPort, certificate_file, &lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; topic, message, retain_flag?"-r":"");&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; break;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; case PSK:&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sprintf(cmdString,&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; "mosquitto_pub -h %s -p %d --psk-identity %s --psk %s -t %s -m \"%s\" %s",&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mqtt_broker, serverPort, psk_identity, psk_password, &lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; topic, message, retain_flag?"-r":"");&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; break;&lt;/p&gt;&lt;p&gt;&amp;#160; }&lt;/p&gt;&lt;p&gt;&amp;#160; if (!(ppipe = (FILE *)popen(cmdString, "w"))) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; retval = false;&lt;/p&gt;&lt;p&gt;&amp;#160; }&lt;/p&gt;&lt;p&gt;&amp;#160; if (fputs(cmdString, ppipe) != EOF) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; retval = true;&lt;/p&gt;&lt;p&gt;&amp;#160; }&lt;/p&gt;&lt;p&gt;&amp;#160; else {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; retval = false;&lt;/p&gt;&lt;p&gt;&amp;#160; }&lt;/p&gt;&lt;p&gt;&amp;#160; fclose(ppipe);&lt;/p&gt;&lt;p&gt;&amp;#160; return retval;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;/*======================================================================&lt;/p&gt;&lt;p&gt;&amp;#160; Parse data in the data buffer to topic and message buffer&lt;/p&gt;&lt;p&gt;&amp;#160; delimiter is the first space&lt;/p&gt;&lt;p&gt;&amp;#160; if there is only one recognizable string, it is assumed a message &lt;/p&gt;&lt;p&gt;&amp;#160; string and topic is set to NULL&lt;/p&gt;&lt;p&gt;========================================================================*/&lt;/p&gt;&lt;p&gt;void MQTTClient::parseDataBuffer()&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;#160; topic&amp;#160;&amp;#160; = dataBuffer;&lt;/p&gt;&lt;p&gt;&amp;#160; message = dataBuffer;&lt;/p&gt;&lt;p&gt;&amp;#160; while((*message) != 0) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; if ((*message) == 0x20) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // replace the first space with the NULL character&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; (*message) = 0;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; message++;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; break;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; else {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; message++;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;&lt;p&gt;&amp;#160; }&lt;/p&gt;&lt;p&gt;&amp;#160; if (strlen(message) == 0) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; topic&amp;#160;&amp;#160; = NULL;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; message = dataBuffer;&lt;/p&gt;&lt;p&gt;&amp;#160; }&amp;#160; &lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;/pre&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;!--[CodeBlockStart:bd3746c0-1026-4269-8c0a-e7c9b04b4831][excluded]--&gt;&lt;pre class="c++" name="code"&gt;// File: MQTTClient.h
/*
&amp;#160; Minimalist MQTT Client using mosquitto_sub and mosquitto_pub
&amp;#160; Assume Mosquitto MQTT server already installed and mosquitto_pub/sub 
&amp;#160; are in search path
*/


#ifndef __MQTTClient_H__
#define __MQTTClient_H__


#include &amp;lt;Arduino.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;


enum security_mode {OPEN = 0, SSL = 1, PSK = 2};


class MQTTClient {


&amp;#160; public:
&amp;#160;&amp;#160;&amp;#160; MQTTClient();
&amp;#160;&amp;#160;&amp;#160; ~MQTTClient();
&amp;#160;&amp;#160;&amp;#160; void&amp;#160;&amp;#160;&amp;#160; begin(char * broker, int port, security_mode mode, 
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; char* certificate_file, char *psk_identity, char *psk);
&amp;#160;&amp;#160;&amp;#160; boolean publish(char *topic, char *message);
&amp;#160;&amp;#160;&amp;#160; boolean subscribe(char* topic, void (*callback)(char *topic, char* message));
&amp;#160;&amp;#160;&amp;#160; boolean loop();
&amp;#160;&amp;#160;&amp;#160; boolean available();
&amp;#160;&amp;#160;&amp;#160; void&amp;#160;&amp;#160;&amp;#160; close();


&amp;#160; private:
&amp;#160;&amp;#160;&amp;#160; void&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; parseDataBuffer();
&amp;#160;&amp;#160;&amp;#160; FILE*&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; spipe;
&amp;#160;&amp;#160;&amp;#160; char&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mqtt_broker[32];
&amp;#160;&amp;#160;&amp;#160; security_mode&amp;#160; mode;
&amp;#160;&amp;#160;&amp;#160; char&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; topicString[64];
&amp;#160;&amp;#160;&amp;#160; char&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; certificate_file[64];
&amp;#160;&amp;#160;&amp;#160; char&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; psk_identity[32];
&amp;#160;&amp;#160;&amp;#160; char&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; psk_password[32];
&amp;#160;&amp;#160;&amp;#160; int&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; serverPort;
&amp;#160;&amp;#160;&amp;#160; char&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; *topic;
&amp;#160;&amp;#160;&amp;#160; char&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; *message;
&amp;#160;&amp;#160;&amp;#160; boolean&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; retain_flag;
&amp;#160;&amp;#160;&amp;#160; void&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; (*callback_function)(char* topic, char* message);
&amp;#160;&amp;#160;&amp;#160; char&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; dataBuffer[256];
};
#endif
&lt;/pre&gt;&lt;!--[CodeBlockEnd:bd3746c0-1026-4269-8c0a-e7c9b04b4831]--&gt;&lt;div style="display:none;"&gt;&lt;/div&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Main Sketch&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;This sketch is basically running only the basic functions but I will keep updating as I implement more sensors and features.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;!--[CodeBlockStart:008148e5-293e-4d06-9b0f-0945475d97d8][excluded]--&gt;&lt;pre class="c++" name="code"&gt;//Rotary Growing System


// MQTT
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;Arduino.h&amp;gt;


#include "MQTTClient.h"


#define SECURE_MODE&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0
// 0 = No security
// 1 = SSL security
// 2 = TLS-PSK security


MQTTClient&amp;#160;&amp;#160;&amp;#160;&amp;#160; mqttClient;
unsigned long&amp;#160; mqttPubInterval_1 = 1000;&amp;#160; // interval for publishing critical values
unsigned long&amp;#160; mqttPubInterval_2 = 5000;&amp;#160; // interval for publishing non-critical values
unsigned long&amp;#160; previousMqttMillis = 0;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 
char&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; fmtString[256];&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // utility string
char&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; topicString[64];&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // topic for publishing
char&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; msgString[14];&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // message
bool&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; autoManual = 1;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // mode initially set to automatic




unsigned long&amp;#160; currentMillis;


//Stepper Motor
int&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; drumRPH = 5;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // default drum rotation set at 5 Rotation per Hour
const int&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; stepperPin = 3;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // stepper pulse pin
const int&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; stepperENA = 4;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // stepper enable pin
int&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; stepperInterval;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // interval at which to pulse (milliseconds) calculated&amp;#160; dividing 2400 / required drum RPH
unsigned long&amp;#160;&amp;#160; previousStepperMillis = 0;&amp;#160; // for stepper motor pulse
bool&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; remoteDrum = 0;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // value received from MQTT pub to set drum ON or OFF remotely, default OFF "0"


//Grow Light
const int&amp;#160;&amp;#160; growLight = 5;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // growLight pin
int&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; set_on = 8;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // default on time
int&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; set_off = 20;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // default off time
char&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; date[100];&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // date display format
bool&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; remoteGrowLight = HIGH;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // value received from MQTT pub to set light ON or OFF remotely, default OFF "HIGH"


//Water Pump
const int&amp;#160;&amp;#160;&amp;#160;&amp;#160; waterPump = 6;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // water pump relay pin
unsigned long pumpInterval = 1800000;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // interval pump will switch on (every 30 min)
unsigned long pumpOnTime = 10000;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // default time pump stays on every cycle (10 seconds)
unsigned long previousPumpMillis = 0;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // for water pump timer
bool&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; remoteWaterPump = HIGH;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // value received from MQTT pub to set water pump ON or OFF remotely, default OFF "HIGH"


//Temperature Sensor
const int&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; pinTempSen = A0;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // pin of temperature sensor
float&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; temp;




//Light Sensor
const int&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; pinLightSen = A3;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // pin of light sensor
int&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lightSensor = 0;
int&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lux;


//LCD DISPLAY
#include &amp;lt;rgb_lcd.h&amp;gt;
#include &amp;lt;Wire.h&amp;gt;
rgb_lcd lcd;


int&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; screen = 0;
int&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; screenMax = 5;
bool&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; screenChanged = true;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // initially we have a new screen,&amp;#160; by definition
unsigned long previousLCDMillis = 0;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // for LCD screen update
unsigned long lcdInterval = 4000;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // LCD change interval
char&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; timenow[50];


// defines of the screens to show
#define TEMPERATURE 0
#define LUX&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1
#define RPH&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2
#define TIME&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3
#define HUMIDITY&amp;#160;&amp;#160;&amp;#160; 4
#define PH&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 5




void setup()
{
&amp;#160; pinMode(growLight, OUTPUT);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // light pin
&amp;#160; digitalWrite (growLight, HIGH);&amp;#160;&amp;#160;&amp;#160;&amp;#160; // relay switches off at HIGH&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 
&amp;#160; pinMode(waterPump, OUTPUT);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // waterPump pin
&amp;#160; digitalWrite (waterPump, HIGH);&amp;#160;&amp;#160;&amp;#160;&amp;#160; // relay switches off at HIGH
&amp;#160; pinMode(stepperENA, OUTPUT);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // stepper Enable pin
&amp;#160; digitalWrite (stepperENA, LOW);&amp;#160;&amp;#160;&amp;#160;&amp;#160; // stepper Enable OFF
&amp;#160; pinMode(stepperPin, OUTPUT);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // stepper motor pulse pin&amp;#160; 
&amp;#160; 
&amp;#160; Serial.begin(9600);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //initialize serial communications at 9600 bps
&amp;#160; Serial.println ("\n Initialising Rotary Growing System");
&amp;#160; 
&amp;#160; lcd.begin(16, 2);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // set up the LCD's number of columns and rows
&amp;#160; lcd.clear();
&amp;#160; lcd.setCursor(0, 0);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // set the cursor to column 0, line 0
&amp;#160; lcd.print("Initialising...");
&amp;#160; delay(2000);
&amp;#160; lcd.clear();
&amp;#160; lcd.setCursor(1, 0);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // set the cursor to column 1, line 0
&amp;#160; lcd.print("Rotary Growing");
&amp;#160; lcd.setCursor(5, 1);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // set the cursor to column 5, line 1
&amp;#160; lcd.print("System");
&amp;#160; delay(3000);


&amp;#160; // initializing MQTTClient
&amp;#160; #if ( SECURE_MODE == 0 )
&amp;#160;&amp;#160;&amp;#160; Serial.println("No security");
&amp;#160;&amp;#160;&amp;#160; mqttClient.begin("localhost", 1883, OPEN, NULL, NULL, NULL);
&amp;#160; #elif ( SECURE_MODE == 1 )
&amp;#160;&amp;#160;&amp;#160; Serial.println("SSL security");
&amp;#160;&amp;#160;&amp;#160; mqttClient.begin("localhost", 1994, SSL, "/home/mosquitto/certs/ca.crt", NULL, NULL);
&amp;#160; #elif ( SECURE_MODE == 2 )
&amp;#160;&amp;#160; Serial.println("TLS-PSK security");
&amp;#160;&amp;#160; mqttClient.begin("localhost", 1995, PSK, NULL, "user", "deadbeef");
&amp;#160; #endif


&amp;#160; // subscribe to all topics published under edison
&amp;#160; mqttClient.subscribe("edison/#", mqttCallback);
&amp;#160; mqttClient.publish("edison/sysMsg", "Rotary Growing System Booted");
&amp;#160; mqttClient.publish("edison/autoManual", "A");&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // publish default Mode to sincronise remote values
&amp;#160; sprintf(msgString, "%d", drumRPH);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // read default drumRPH value
&amp;#160; mqttClient.publish("edison/drumRPH", msgString);&amp;#160;&amp;#160; // publish default drumRPH to sincronise remote values
&amp;#160; sprintf(msgString, "%d", set_on);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // read default set_on value
&amp;#160; mqttClient.publish("edison/set_on", msgString);&amp;#160;&amp;#160;&amp;#160; // publish default light set_on time to sincronise remote values
&amp;#160; sprintf(msgString, "%d", set_off);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // read default set_off value
&amp;#160; mqttClient.publish("edison/set_on", msgString);&amp;#160;&amp;#160;&amp;#160; // publish default light set_off time to sincronise remote values
}


// MQTT Callback function


void mqttCallback(char* topic, char* message)
{
&amp;#160; sprintf(fmtString, "mqttCallback(), topic: %s, message: %s", topic, message);
&amp;#160; Serial.print(fmtString);


&amp;#160; // Setting Drum RPH
&amp;#160; if (strcmp(topic, "edison/drumRPH") == 0) {&amp;#160;&amp;#160;&amp;#160;&amp;#160; //check the topic then execute command as appropriate
&amp;#160;&amp;#160; drumRPH = atoi(message);
&amp;#160; }


&amp;#160; //Seting grow light time ON
&amp;#160; if (strcmp(topic, "edison/set_on") == 0) {&amp;#160;&amp;#160;&amp;#160;&amp;#160; //check the topic then execute command as appropriate
&amp;#160;&amp;#160;&amp;#160; set_on = atoi(message);
&amp;#160; }


&amp;#160;&amp;#160;&amp;#160; //Seting grow light time OFF
&amp;#160; if (strcmp(topic, "edison/set_off") == 0) {&amp;#160;&amp;#160;&amp;#160;&amp;#160; //check the topic then execute command as appropriate
&amp;#160;&amp;#160;&amp;#160; set_off = atoi(message);
&amp;#160; }




&amp;#160; //Set Auto or Manual Mode
&amp;#160; if (strcmp(topic, "edison/autoManual") == 0) {&amp;#160; //check the topic then execute command as appropriate
&amp;#160;&amp;#160;&amp;#160; if (message[0] == 'A') {&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //set mode to 1 if Automatic
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; autoManual = 1;
&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160; else {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; autoManual = 0;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //set mode to 0 if Manual
&amp;#160;&amp;#160;&amp;#160; }
&amp;#160; }


&amp;#160; // Switching Drum ON / OFF
&amp;#160; if (strcmp(topic, "edison/remoteDrum") == 0) {
&amp;#160;&amp;#160;&amp;#160; // then execute command as appropriate
&amp;#160;&amp;#160;&amp;#160; if (strncmp(message, "ON", 2) == 0) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; remoteDrum = 1;
&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160; else {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; remoteDrum = 0;
&amp;#160;&amp;#160;&amp;#160; }
&amp;#160; }
&amp;#160; 
&amp;#160;&amp;#160;&amp;#160; 
&amp;#160; //Grow Light remote control
&amp;#160; if (strcmp(topic, "edison/remoteGrowLight") == 0) {
&amp;#160;&amp;#160;&amp;#160; // then execute command as appropriate
&amp;#160;&amp;#160;&amp;#160; if (strncmp(message, "ON", 2) == 0) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; remoteGrowLight = LOW;
&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160; else {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; remoteGrowLight = HIGH;
&amp;#160;&amp;#160;&amp;#160; }
&amp;#160; }




&amp;#160; //Water Pump remote control
&amp;#160; if (strcmp(topic, "edison/remoteWaterPump") == 0) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // then execute command as appropriate
&amp;#160;&amp;#160;&amp;#160; if (strncmp(message, "ON", 2) == 0) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; remoteWaterPump = LOW;
&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160; else {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; remoteWaterPump = HIGH;
&amp;#160;&amp;#160;&amp;#160; }
&amp;#160; }


&amp;#160; 
}




void loop()
{
&amp;#160; mqttClient.loop();&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // check for any new message from mqtt_sub
&amp;#160; currentMillis = millis();
&amp;#160; stepperMotor();&amp;#160; 
&amp;#160; lightTimer();
&amp;#160; waterPumpTimer();
&amp;#160; grooveTempSen();
&amp;#160; grooveLightSen();
&amp;#160; grooveLCD();
&amp;#160; edisonMQTT();


}


//========================================================================================================================================


void stepperMotor()
{
&amp;#160; // check to see if it's time to pulse; that is, if the
&amp;#160; // difference between the current time and last pulse time
&amp;#160; // is bigger than the interval at which you want to pulse
&amp;#160; 
&amp;#160; stepperInterval = 2400/drumRPH;
&amp;#160; bool pulseState;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // pulseState used to set the stepperPin
&amp;#160; 
&amp;#160; if (autoManual == 1 || (autoManual == 0 &amp;amp;&amp;amp; remoteDrum == 1)){
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; digitalWrite(stepperENA, LOW);
&amp;#160;&amp;#160;&amp;#160; if (currentMillis - previousStepperMillis &amp;gt;= stepperInterval) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; previousStepperMillis = currentMillis;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // save the last Pulse time
&amp;#160; 
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // if the Pulse is off turn it on and vice-versa:
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (pulseState == LOW) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; pulseState = HIGH;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } else {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; pulseState = LOW;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // set the stepperPin with the pulseState of the variable:
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; digitalWrite(stepperPin, pulseState);
&amp;#160;&amp;#160;&amp;#160; }
&amp;#160; }
&amp;#160; else {
&amp;#160;&amp;#160;&amp;#160; pulseState = LOW;
&amp;#160;&amp;#160;&amp;#160; digitalWrite(stepperENA, HIGH);
&amp;#160; }
}


//========================================================================================================================================


void lightTimer() {


&amp;#160; time_t t = time(NULL);
&amp;#160; struct tm tm = *localtime(&amp;amp;t);
&amp;#160; sprintf(date, "%02d/%02d/%04d %02d:%02d:%02d", tm.tm_mday, tm.tm_mon + 1, tm.tm_year + 1900, tm.tm_hour, tm.tm_min, tm.tm_sec);
&amp;#160; sprintf(timenow, "%02d:%02d:%02d", tm.tm_hour, tm.tm_min, tm.tm_sec);
&amp;#160; Serial.println(timenow);




&amp;#160; //if(set_on == set_off){
&amp;#160; //&amp;#160;&amp;#160; digitalWrite(growLight, HIGH);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //HIGH sets light relay off
&amp;#160; //&amp;#160;&amp;#160; Serial.println("Same On and OFF hours. Set at least 1h difference");
&amp;#160; //}
&amp;#160; //
&amp;#160; //if(set_on &amp;gt;23){
&amp;#160; //&amp;#160;&amp;#160; digitalWrite(growLight, HIGH);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //HIGH sets light relay off
&amp;#160; //&amp;#160;&amp;#160; Serial.println("Invalid hour value, choose from 0 until 23");
&amp;#160; //}
&amp;#160; //
&amp;#160; //if(set_off &amp;gt;23){
&amp;#160; //&amp;#160;&amp;#160; digitalWrite(growLight, HIGH);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //HIGH sets light relay off
&amp;#160; //&amp;#160;&amp;#160; Serial.println("Invalid hour value, choose from 0 until 23");
&amp;#160; //}




&amp;#160; if (autoManual == 1) {
&amp;#160;&amp;#160;&amp;#160; if (tm.tm_hour &amp;gt;= set_on &amp;amp;&amp;amp; tm.tm_hour &amp;lt; set_off)&amp;#160;&amp;#160;&amp;#160; //Start timer
&amp;#160;&amp;#160;&amp;#160; {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; digitalWrite(growLight, LOW);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //LOW sets light relay on
&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160; else {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; digitalWrite(growLight, HIGH);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //HIGH sets light relay off
&amp;#160;&amp;#160;&amp;#160; }
&amp;#160; }
&amp;#160; else {
&amp;#160;&amp;#160;&amp;#160; Serial.println("Manual Mode Selected");
&amp;#160;&amp;#160;&amp;#160; digitalWrite(growLight, remoteGrowLight);
&amp;#160; }
}


//========================================================================================================================================


void waterPumpTimer() {
&amp;#160; // check to see if it's time to switch the water pump; if the
&amp;#160; // difference between the current time and last time the pump was on
&amp;#160; // is bigger than the interval set on pumpInterval
&amp;#160; // than switch it on for the time set on pumpOnTime
&amp;#160; 
&amp;#160; if (autoManual == 1) {
&amp;#160;&amp;#160;&amp;#160; if (currentMillis - previousPumpMillis &amp;gt;= pumpInterval) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; previousPumpMillis = currentMillis;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // save the last pump interval on time
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; unsigned long previousPumpOnMillis;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (currentMillis - previousPumpOnMillis &amp;gt;= pumpOnTime) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; previousPumpOnMillis = currentMillis;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // save the last pump time on time
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; digitalWrite(waterPump, LOW);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // turn water pump ON
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; digitalWrite(waterPump, HIGH);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // turn water pump OFF
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160; else {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; digitalWrite(waterPump, HIGH);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // turn water pump OFF
&amp;#160;&amp;#160;&amp;#160; }
&amp;#160; }
&amp;#160; else {
&amp;#160;&amp;#160;&amp;#160; digitalWrite(waterPump, remoteWaterPump);
&amp;#160; }


}


//========================================================================================================================================


void grooveTempSen()&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // grove temperature sensor
{
&amp;#160; int B = 3975;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // B value of the thermistor
&amp;#160; float resistance;
&amp;#160; int val = analogRead(pinTempSen);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // get analog value
&amp;#160; resistance = (float)(1023 - val) * 10000 / val;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // get resistance
&amp;#160; temp = 1 / (log(resistance / 10000) / B + 1 / 298.15) - 273.15;&amp;#160; // calc temperature
&amp;#160; //&amp;#160;&amp;#160;&amp;#160; Serial.print("Temp: ");
&amp;#160; //&amp;#160;&amp;#160;&amp;#160; Serial.print(temp);
&amp;#160; //&amp;#160;&amp;#160;&amp;#160; Serial.println(" &amp;#186;C");


}


//========================================================================================================================================


void grooveLightSen()&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // grove light sensor
{
&amp;#160; lightSensor = analogRead(pinLightSen);
&amp;#160; lux = lightSensor;
&amp;#160; //&amp;#160;&amp;#160;&amp;#160; Serial.print("Light: ");
&amp;#160; //&amp;#160;&amp;#160;&amp;#160; Serial.print(lux);
&amp;#160; //&amp;#160;&amp;#160;&amp;#160; Serial.println(" LUX");
}


//========================================================================================================================================


void grooveLCD() {&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // groove LCD RGB display


&amp;#160; unsigned long currentLCDMillis = millis();


&amp;#160; char number[4];


&amp;#160; { if (currentLCDMillis - previousLCDMillis &amp;gt; lcdInterval)&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // save the last time you changed the display
&amp;#160;&amp;#160;&amp;#160; {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; previousLCDMillis = currentLCDMillis;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; screen++;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (screen &amp;gt; screenMax) screen = 0;&amp;#160; // all screens done? =&amp;gt; start over
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; screenChanged = true;
&amp;#160;&amp;#160;&amp;#160; }


&amp;#160;&amp;#160;&amp;#160; // debug Serial.println(screen);




&amp;#160;&amp;#160;&amp;#160; // DISPLAY CURRENT SCREEN
&amp;#160;&amp;#160;&amp;#160; if (screenChanged)&amp;#160;&amp;#160; // only update the screen if the screen is changed.
&amp;#160;&amp;#160;&amp;#160; {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; screenChanged = false; // reset for next iteration
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; switch (screen)
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; case TEMPERATURE:
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //print temperature
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.clear();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.print("Temperature");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.setCursor(0, 1);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sprintf(number, "%02.01f", temp);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.setCursor(3, 1);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.print(number);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.print(" C");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; break;


&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; case LUX:
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //print light
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.clear();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.print("Light");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.setCursor(0, 1);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sprintf(number, "%d", lux);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.setCursor(3, 1);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.print(number);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.print(" LUX");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; break;


&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; case RPH:
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //print RPM&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // drum rotation per hour
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.clear();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.print("Drum Speed");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.setCursor(0, 1);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sprintf(number, "%d", (drumRPH));
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.setCursor(3, 1);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.print(number);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.print(" RPH");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; break;


&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; case TIME:
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //print TIME
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.clear();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.print(timenow);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.setCursor(0, 1);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.print("GROW LIGHT: ");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.setCursor(13, 1);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (digitalRead (growLight) == LOW) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.print("ON");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.print("OFF");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; break;


&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; case HUMIDITY:
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //print humidity
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.clear();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.print("Humidity");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.setCursor(0, 1);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //sprintf(number,"%d",humid);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.setCursor(3, 1);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.print(38);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.print(" %");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; break;


&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; case PH:
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //print PH
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.clear();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.print("PH");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.setCursor(0, 1);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //sprintf(number,"%02.01f",ph);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.setCursor(3, 1);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcd.print(6.5);




&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; default:
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // cannot happen -&amp;gt; showError() ?
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; break;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }


&amp;#160;&amp;#160;&amp;#160; }
&amp;#160; }
}


//========================================================================================================================================


void edisonMQTT() {


&amp;#160; 
&amp;#160; //critical information publishes immediately
&amp;#160; if (currentMillis - previousMqttMillis &amp;gt;= mqttPubInterval_1) {&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 
&amp;#160;&amp;#160;&amp;#160; previousMqttMillis = currentMillis;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // save the last Pulse time
&amp;#160;&amp;#160; 
&amp;#160;&amp;#160;&amp;#160; // publish drum Stopped
&amp;#160;&amp;#160;&amp;#160; if (stepperENA == HIGH){
&amp;#160;&amp;#160;&amp;#160; mqttClient.publish("edison/sysMsg", "DRUM STOPPED");
&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160; 
&amp;#160;&amp;#160;&amp;#160; // publish light issue
&amp;#160;&amp;#160;&amp;#160; if ((digitalRead (growLight) == LOW) &amp;amp;&amp;amp; (lux &amp;lt; 500)) {
&amp;#160;&amp;#160;&amp;#160; mqttClient.publish("edison/sysMsg", "FAULTY LIGHT");
&amp;#160;&amp;#160;&amp;#160; }


&amp;#160;&amp;#160;&amp;#160; // publish Auto/Manual mode change
&amp;#160;&amp;#160;&amp;#160; bool modeState;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // indicates toggle on mode state
&amp;#160;&amp;#160;&amp;#160; if (modeState == LOW &amp;amp;&amp;amp;&amp;#160; autoManual == 1) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mqttClient.publish("edison/sysMsg", "MODE SET TO: AUTO");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; modeState = HIGH;
&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160; if (modeState == HIGH &amp;amp;&amp;amp;&amp;#160; autoManual == 0) {
&amp;#160;&amp;#160;&amp;#160; mqttClient.publish("edison/sysMsg", "MODE SET TO: MANUAL");
&amp;#160;&amp;#160;&amp;#160; modeState = LOW;
&amp;#160;&amp;#160;&amp;#160; }

&amp;#160;&amp;#160;&amp;#160; // publish grow light switching on or off
&amp;#160;&amp;#160;&amp;#160; bool lightState;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // indicates toggle on light state
&amp;#160;&amp;#160;&amp;#160; if (lightState == LOW &amp;amp;&amp;amp;&amp;#160; (digitalRead (growLight) == HIGH)) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mqttClient.publish("edison/growLight", "OFF");&amp;#160;&amp;#160;&amp;#160; 
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lightState = HIGH;
&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160; if (lightState == HIGH &amp;amp;&amp;amp;&amp;#160; (digitalRead (growLight) == LOW)) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mqttClient.publish("edison/growLight", "ON");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lightState = HIGH;
&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160; 
&amp;#160;&amp;#160;&amp;#160; // publish grow light switching on or off
&amp;#160;&amp;#160;&amp;#160; bool waterPumpState;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // indicates toggle on water pump state
&amp;#160;&amp;#160;&amp;#160; if (waterPumpState == LOW &amp;amp;&amp;amp;&amp;#160; (digitalRead (waterPump) == HIGH)) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mqttClient.publish("edison/waterPump", "OFF");&amp;#160;&amp;#160;&amp;#160; 
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; waterPumpState = HIGH;
&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160; if (waterPumpState == HIGH &amp;amp;&amp;amp;&amp;#160; (digitalRead (waterPump) == LOW)) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mqttClient.publish("edison/waterPump", "ON");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; waterPumpState = HIGH;
&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160; 
&amp;#160;&amp;#160; }
&amp;#160; 
&amp;#160; 
&amp;#160; //non-critical information publishes every 10 minutes
&amp;#160; if (currentMillis - previousMqttMillis &amp;gt;= mqttPubInterval_2) {
&amp;#160;&amp;#160;&amp;#160; previousMqttMillis = currentMillis;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // save the last Pulse time
&amp;#160;&amp;#160;&amp;#160; 
&amp;#160;&amp;#160;&amp;#160; // publish temperature
&amp;#160;&amp;#160;&amp;#160; sprintf(msgString, "%02.01f", temp);
&amp;#160;&amp;#160;&amp;#160; mqttClient.publish("edison/temperature", msgString);


&amp;#160;&amp;#160;&amp;#160; // publish light sensor reading
&amp;#160;&amp;#160;&amp;#160; sprintf(msgString, "%d", lux);
&amp;#160;&amp;#160;&amp;#160; mqttClient.publish("edison/lightSensor", msgString);


//&amp;#160;&amp;#160;&amp;#160; // publish hunidity sensor reading
//&amp;#160;&amp;#160;&amp;#160; sprintf(msgString, "%d", humid);
//&amp;#160;&amp;#160;&amp;#160; mqttClient.publish("edison/humidity", msgString);
//
//&amp;#160;&amp;#160;&amp;#160; // publish PH
//&amp;#160;&amp;#160;&amp;#160; sprintf(msgString, "%02.01f", ph);
//&amp;#160;&amp;#160;&amp;#160; mqttClient.publish("edison/ph", msgString);


&amp;#160;&amp;#160;&amp;#160; 
&amp;#160; }
&amp;#160; 
}


//END
&lt;/pre&gt;&lt;!--[CodeBlockEnd:008148e5-293e-4d06-9b0f-0945475d97d8]--&gt;&lt;div style="display:none;"&gt;&lt;/div&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;On my mobile, I installed MQTT Dashboard so we can get the feeds and publish values such as Light Time Set On/Off and&amp;#160; Drum RPH (Rotations per hour)&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25592-419939/Screenshot_20170604-170955.png"&gt;&lt;img alt="Screenshot_20170604-170955.png" class="image-2 jive-image" height="398" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25592-419939/224-398/Screenshot_20170604-170955.png" style="width:224px; height: 398.142px;" width="224"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25592-419842/Screenshot_20170604-170917.png"&gt;&lt;img alt="Screenshot_20170604-170917.png" class="image-1 jive-image" height="400" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25592-419842/225-400/Screenshot_20170604-170917.png" style="width:225px; height: 399.919px;" width="225"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25592-419940/Screenshot_20170604-211219.png"&gt;&lt;img alt="Screenshot_20170604-211219.png" class="image-3 jive-image" height="402" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25592-419940/226-402/Screenshot_20170604-211219.png" style="width:226px; height: 401.697px;" width="226"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:0435ecd1-6311-4a22-a62d-e0395ff2e878] --&gt;</description>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">hydroponics</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">intel edison</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">arduino ide</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycle_it</category>
      <pubDate>Mon, 05 Jun 2017 00:42:55 GMT</pubDate>
      <author>messages@element14.com</author>
      <guid>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/05/upcycle-it-washing-machine-hydroponic-grower-10-programming</guid>
      <dc:date>2017-06-05T00:42:55Z</dc:date>
      <clearspace:dateToText>1 month ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
      <wfw:comment>https://www.element14.com/community/community/design-challenges/upcycleit/blog/comment/upcycle-it-washing-machine-hydroponic-grower-10-programming</wfw:comment>
      <wfw:commentRss>https://www.element14.com/community/community/design-challenges/upcycleit/blog/feeds/comments?blogPost=25592</wfw:commentRss>
    </item>
    <item>
      <title>Upcycle It - Washing Machine Hydroponic Grower - #9 Interfacing Edison X Grower</title>
      <link>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/05/upcycle-it-washing-machine-hydroponic-grower-9-interfacing-edison-x-grower</link>
      <description>&lt;!-- [DocumentBodyStart:bbd2c633-ad4b-452f-b1fc-1ff48c3447d7] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;&lt;strong&gt;Details of electrical connections for the grow light and water pump&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;The relays that switch the light and the water pump were enclosed inside a junction box so there are no exposed wires and terminals for this part of the circuit.&lt;/p&gt;&lt;p&gt;The control cables came through the machine frame just where I gonna fix the Edison Board. The relay block has 4 relays but at this stage, I am using only 2.&lt;/p&gt;&lt;p&gt;The other 2 I will have as spare as I have plans to install an air blower to force air into the drum if it gets too hot or too humid and an air pump to aerate the nutrient.&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25611-418285/IMG_20170530_175604798.jpg"&gt;&lt;img alt="IMG_20170530_175604798.jpg" class="image-1 jive-image" height="334" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25611-418285/188-334/IMG_20170530_175604798.jpg" style="width:188px; height: 334.155px;" width="188"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25611-418415/IMG_20170531_204956018.jpg"&gt;&lt;img alt="IMG_20170531_204956018.jpg" class="image-2 jive-image" height="334" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25611-418415/188-334/IMG_20170531_204956018.jpg" style="width:188px; height: 333.775px;" width="188"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25611-418416/IMG_20170531_205118908.jpg"&gt;&lt;img alt="IMG_20170531_205118908.jpg" class="image-3 jive-image" height="334" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25611-418416/594-334/IMG_20170531_205118908.jpg" style="width:594px; height: 334.365px;" width="594"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25611-418417/IMG_20170531_210116383.jpg"&gt;&lt;img alt="IMG_20170531_210116383.jpg" class="image-4 jive-image" height="279" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25611-418417/496-279/IMG_20170531_210116383.jpg" style="width:496px; height: 279.174px;" width="496"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25611-418418/IMG_20170531_205100958.jpg"&gt;&lt;img alt="IMG_20170531_205100958.jpg" class="image-5 jive-image" height="279" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25611-418418/496-279/IMG_20170531_205100958.jpg" style="width:496px; height: 279.2px;" width="496"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Edison/Arduino Board &amp;amp; LCD Display&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;The Edison board was fixed on the back of the machine. It is far from the water and moisture and easily accessible. The display above facing the front side of the machine and on the left side is the&amp;#160; PH sensor board.&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25611-419836/IMG_20170604_185439593.jpg"&gt;&lt;img alt="IMG_20170604_185439593.jpg" class="image-9 jive-image" height="282" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25611-419836/501-282/IMG_20170604_185439593.jpg" style="width:501px; height: 282.015px;" width="501"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25611-419840/IMG_20170604_190309860.jpg"&gt;&lt;img alt="IMG_20170604_190309860.jpg" class="image-10 jive-image" height="283" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25611-419840/503-283/IMG_20170604_190309860.jpg" style="width:503px; height: 283.193px;" width="503"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Temperature/Humidity &amp;amp; Light Sensors&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;The sensors to monitor the drum temperature, humidity and light intensity were fixed on the light mounting. This is the only spot I could find that will not be on the way of the moving plants or blocking the light.&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25611-426181/IMG_20170616_180755790.jpg"&gt;&lt;img alt="IMG_20170616_180755790.jpg" class="image-13 jive-image" height="512" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25611-426181/288-512/IMG_20170616_180755790.jpg" style="width:288px; height: 511.689px;" width="288"/&gt;&lt;/a&gt; &lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25611-426180/IMG_20170616_180727111.jpg"&gt;&lt;img alt="IMG_20170616_180727111.jpg" class="image-12 jive-image" height="514" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25611-426180/289-514/IMG_20170616_180727111.jpg" style="width:289px; height: 514.032px;" width="289"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Stepper Motor/Driver&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25611-419944/IMG_20170604_191421800.jpg"&gt;&lt;img alt="IMG_20170604_191421800.jpg" class="image-11 jive-image" height="551" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25611-419944/310-551/IMG_20170604_191421800.jpg" style="width:310px; height: 551.383px;" width="310"/&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;PH probe/board&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;The PH probe is fixed on the dump pipe and submerged into the lower reservoir. Its board is fixed next to the Edison board.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25611-419834/IMG_20170604_191337796_HDR.jpg"&gt;&lt;img alt="IMG_20170604_191337796_HDR.jpg" class="image-7 jive-image" height="251" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25611-419834/446-251/IMG_20170604_191337796_HDR.jpg" style="width:446px; height: 251.055px;" width="446"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25611-419835/IMG_20170604_191408737.jpg"&gt;&lt;img alt="IMG_20170604_191408737.jpg" class="image-8 jive-image" height="252" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25611-419835/447-252/IMG_20170604_191408737.jpg" style="width:447px; height: 251.618px;" width="447"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:bbd2c633-ad4b-452f-b1fc-1ff48c3447d7] --&gt;</description>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">washing_machine</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">hydroponics</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycle it</category>
      <pubDate>Mon, 05 Jun 2017 00:41:53 GMT</pubDate>
      <author>messages@element14.com</author>
      <guid>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/05/upcycle-it-washing-machine-hydroponic-grower-9-interfacing-edison-x-grower</guid>
      <dc:date>2017-06-05T00:41:53Z</dc:date>
      <clearspace:dateToText>3 weeks 5 days ago</clearspace:dateToText>
      <clearspace:replyCount>7</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
      <wfw:comment>https://www.element14.com/community/community/design-challenges/upcycleit/blog/comment/upcycle-it-washing-machine-hydroponic-grower-9-interfacing-edison-x-grower</wfw:comment>
      <wfw:commentRss>https://www.element14.com/community/community/design-challenges/upcycleit/blog/feeds/comments?blogPost=25611</wfw:commentRss>
    </item>
    <item>
      <title>Upcycle It - Washing Machine Hydroponic Grower - #8 Nutrient Solution System</title>
      <link>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/05/upcycle-it-washing-machine-hydroponic-grower-8-water-system</link>
      <description>&lt;!-- [DocumentBodyStart:084382a9-3101-40cd-98a6-1f39bc6d6b96] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;On hydroponic systems, the growing medium has the only function to secure the plant roots in place so it doesn't have any means to nourish the plants as the soil does. Therefore, the water caring a &lt;span style="color: #000000; font-family: 'Open Sans', sans-serif;"&gt;nutrient solution is the sole source of nutrients to the plant.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000; font-family: 'Open Sans', sans-serif;"&gt;Conventional hydroponic systems consist in a reservoir for the nutrient solution and a pump that delivers this solution to the growing trays as required. For rotary systems, the solution normally doesn't need to be pumped as the growing bed will be partly submerged into the reservoir so every complete turn will deliver nutrient to all plants inside the drum.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000; font-family: 'Open Sans', sans-serif;"&gt;In our case, we have a limited volume of water we can store on the bottom of the washing machine drum so we have to combine the 2 methods. We will have the drum partially submerged so the growing medium can absorb the nutrient when dipping into it but due to its low volume it wouldn't last long without refilling it.&amp;#160; So we need an auxiliary reservoir to store the nutrient and pump it into the drum when the drum level is low. The drum and the auxiliary tank will have a level switch. The one on the drum will trigger the pump to refill it and the one on the auxiliary reservoir will set an alarm to be manually filled.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000; font-family: 'Open Sans', sans-serif;"&gt;Below is the nutrient solution system schematic.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000; font-family: 'Open Sans', sans-serif;"&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25563-417504/pastedImage_6.png"&gt;&lt;img class="image-6 jive-image" height="560" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25563-417504/580-560/pastedImage_6.png" style="width:580px; height: 560.182px;" width="580"/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000; font-family: 'Open Sans', sans-serif;"&gt;Details of the items&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000; font-family: 'Open Sans', sans-serif;"&gt;&lt;strong&gt;Reservoir&lt;/strong&gt; - Made using a plastic container. I drilled a hole and installed a threaded fitting with 2 "O" rings to seal the water. I also made a frame on the bottom of the washing machine using 20x20 mm aluminium equal angle so the plastic container is secured in place.&amp;#160; &lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000; font-family: 'Open Sans', sans-serif;"&gt; &lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25563-417507/IMG_20170525_175612238.jpg"&gt;&lt;img alt="IMG_20170525_175612238.jpg" class="image-8 jive-image" height="257" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25563-417507/458-257/IMG_20170525_175612238.jpg" style="width:458px; height: 256.527px;" width="458"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25563-417508/IMG_20170525_175737616.jpg"&gt;&lt;img alt="IMG_20170525_175737616.jpg" class="image-9 jive-image" height="350" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25563-417508/197-350/IMG_20170525_175737616.jpg" style="width:197px; height: 350.402px;" width="197"/&gt;&lt;/a&gt; &lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25563-417509/IMG_20170525_175754618.jpg"&gt;&lt;img alt="IMG_20170525_175754618.jpg" class="image-10 jive-image" height="352" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25563-417509/197-352/IMG_20170525_175754618.jpg" style="width:197px; height: 351.669px;" width="197"/&gt;&lt;/a&gt; &lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25563-417510/IMG_20170525_183738332_HDR.jpg"&gt;&lt;img alt="IMG_20170525_183738332_HDR.jpg" class="image-11 jive-image" height="353" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25563-417510/198-353/IMG_20170525_183738332_HDR.jpg" style="width:198px; height: 352.568px;" width="198"/&gt;&lt;/a&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000; font-family: 'Open Sans', sans-serif;"&gt;&lt;strong&gt;Water Pump&lt;/strong&gt; - Original water pump connected to the reservoir&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000; font-family: 'Open Sans', sans-serif;"&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25563-417502/IMG_20170528_172817032.jpg"&gt;&lt;img alt="IMG_20170528_172817032.jpg" class="image-4 jive-image" height="443" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25563-417502/249-443/IMG_20170528_172817032.jpg" style="width:249px; height: 442.577px;" width="249"/&gt;&lt;/a&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000; font-family: 'Open Sans', sans-serif;"&gt;&lt;strong&gt;Water Level Adjustment&lt;/strong&gt; - Made of 25 mm PVC Pipe, 2 x 90&amp;#186; Elbows and 1 x "T". Connected to the original flex joint that originally was connected to the water pump. I secured the pipe using a wingnut so we can change the water level adjusting the pipe height. &lt;em&gt;Note that the top part of the pipe assembly is open; otherwise, it would become a siphon draining all drum water.&lt;/em&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000; font-family: 'Open Sans', sans-serif;"&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25563-417505/IMG_20170526_175205755.jpg"&gt;&lt;img alt="IMG_20170526_175205755.jpg" class="image-7 jive-image" height="348" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25563-417505/196-348/IMG_20170526_175205755.jpg" style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; width:196px; height: 348.374px;" width="196"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25563-417503/IMG_20170528_192103448.jpg"&gt;&lt;img alt="IMG_20170528_192103448.jpg" class="image-5 jive-image" height="900" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25563-417503/1600-900/IMG_20170528_192103448.jpg" style="width: 620px; height: 349px;" width="1600"/&gt;&lt;/a&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000; font-family: 'Open Sans', sans-serif;"&gt;&lt;strong&gt;Water Level Sensor&lt;/strong&gt; - The original drum water level switch is an interesting piece of equipment, it is a mechanical device that uses air pressure, created by the water weight on the bottom of the drum, to actuate a contact switch. I couldn't imagine but this mechanical sensor can be adjusted to the level we want turning the plastic screws on the back. It took a while to adjust it but I managed to have it switching off when the water inside the drum lowers below the accepted level. This sensor will be used to give a signal to turn the water pump on.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000; font-family: 'Open Sans', sans-serif;"&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25563-417499/IMG_20170522_191426662.jpg"&gt;&lt;img alt="IMG_20170522_191426662.jpg" class="image-1 jive-image" height="346" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25563-417499/194-346/IMG_20170522_191426662.jpg" style="width:194px; height: 345.632px;" width="194"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25563-417500/IMG_20170522_191415624.jpg"&gt;&lt;img alt="IMG_20170522_191415624.jpg" class="image-2 jive-image" height="898" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25563-417500/1600-898/IMG_20170522_191415624.jpg" style="width: 620px; height: 348px;" width="1600"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25563-417501/IMG_20170522_191403142.jpg"&gt;&lt;img alt="IMG_20170522_191403142.jpg" class="image-3 jive-image" height="898" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25563-417501/1600-898/IMG_20170522_191403142.jpg" style="width: 620px; height: 348px;" width="1600"/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000; font-family: 'Open Sans', sans-serif;"&gt;Besides the pump being started once the level inside the tumbler is low. it will also turn on in cycles for 10 seconds every hour to ensure the nutrient solution is refreshed.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000; font-family: 'Open Sans', sans-serif;"&gt;Below is a short video of the water pump cycle testing.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000; font-family: 'Open Sans', sans-serif;"&gt;&lt;span id="f19467ae_89de_4f56_a109_2152f0a582d6"&gt;&lt;div class="e14-video-container" style="max-width: 520px;"&gt;&lt;div class="e14-video"&gt;&lt;iframe allowfullscreen="" data-htmlsrc="VideoPluginMacro" mozallowfullscreen="" src="//players.brightcove.net/1362235890001/NkxiVJdjx_default/index.html?videoId=5451889609001" webkitallowfullscreen=""&gt;
&lt;/iframe&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:084382a9-3101-40cd-98a6-1f39bc6d6b96] --&gt;</description>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">hydroponics</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">intel edison</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycle_it</category>
      <pubDate>Mon, 05 Jun 2017 00:39:39 GMT</pubDate>
      <author>messages@element14.com</author>
      <guid>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/05/upcycle-it-washing-machine-hydroponic-grower-8-water-system</guid>
      <dc:date>2017-06-05T00:39:39Z</dc:date>
      <clearspace:dateToText>1 month 2 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>5</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
      <wfw:comment>https://www.element14.com/community/community/design-challenges/upcycleit/blog/comment/upcycle-it-washing-machine-hydroponic-grower-8-water-system</wfw:comment>
      <wfw:commentRss>https://www.element14.com/community/community/design-challenges/upcycleit/blog/feeds/comments?blogPost=25563</wfw:commentRss>
    </item>
    <item>
      <title>Upcycle It - Washing Machine Hydroponic Grower - #7 Drum RPM Calculation</title>
      <link>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/05/upcycle-it-washing-machine-hydroponic-grower-7-drum-rpm-calculation</link>
      <description>&lt;!-- [DocumentBodyStart:5a7a42dd-de7e-4d58-8249-9777ce7f0bfb] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;To start programming the stepper motor control, I did some tests having the stepper motor turning the drum at different pulse frequencies.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Checking some other rotary growing systems I found that it normally takes 30 to 45 minutes to give a complete turn. I found it very slow (about 0.025 RPM). The beauty of having a stepper motor is that we can virtually set it at any speed below its maximum RPM.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;I decided to physically check the drum RPM applying different pulse frequencies to the stepper controller and measure the turn time. Doing this test I could get the constant relation in between pulse width (ms) and the actual drum RPM.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Below is the code for the testing. I set different pulse frequencies at different pins so I shift the pulse wire through the pins and measured the rotation time.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;pre class="_jivemacro_uid_14955893614838213 jive_macro_code jive_text_macro" data-renderedposition="176_8_1777_1664"&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;//Pulses pins 13, 9 &amp;amp; 8 at different frequencies&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;const int pulsePin13 = 13;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // pin 13 @ 1000ms (on board LED)&lt;/p&gt;&lt;p&gt;const long interval13 = 1000;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // interval at which to pulse pin (milliseconds)&lt;/p&gt;&lt;p&gt;int pinState13 = LOW;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // set pinState to 0 &lt;/p&gt;&lt;p&gt;unsigned long previousMillis13 = 0;&amp;#160;&amp;#160;&amp;#160; // store last time pin was updated&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;pre class="_jivemacro_uid_14955893614838213 jive_macro_code jive_text_macro" data-renderedposition="176_8_1777_1664"&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;const int pulsePin8 = 8;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // pin 8 @ 50ms&lt;/p&gt;&lt;p&gt;const long interval8 = 50;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // interval at which to pulse pin (milliseconds)&lt;/p&gt;&lt;p&gt;int pinState8 = LOW;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // set pinState to 0 &lt;/p&gt;&lt;p&gt;unsigned long previousMillis8 = 0;&amp;#160;&amp;#160;&amp;#160; // store last time pin was updated&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;pre class="_jivemacro_uid_14955893614838213 jive_macro_code jive_text_macro" data-renderedposition="176_8_1777_1664"&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;//Pin13&lt;/p&gt;&lt;p&gt;&amp;#160; if (currentMillis - previousMillis13 &amp;gt;= interval13) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; // save the last pulse time&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; previousMillis13 = currentMillis;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; // if the pin is off turn it on and vice-versa:&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; if (pinState13 == LOW) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; pinState13 = HIGH;&lt;/p&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;const int pulsePin9 = 9;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // pin 9 @ 100ms&lt;/p&gt;&lt;p&gt;const long interval9 = 100;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // interval at which to pulse pin (milliseconds)&lt;/p&gt;&lt;p&gt;int pinState9 = LOW;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // set pinState to 0&lt;/p&gt;&lt;p&gt;unsigned long previousMillis9 = 0;&amp;#160;&amp;#160;&amp;#160; // store last time pin was updated&lt;/p&gt;&lt;pre class="_jivemacro_uid_14955893614838213 jive_macro_code jive_text_macro" data-renderedposition="176_8_1777_1664"&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; } else {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; pinState13 = LOW;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; // set the pin with the pinState of the variable:&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; digitalWrite(pulsePin13, pinState13);&lt;/p&gt;&lt;p&gt;&amp;#160; }&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt; //Pin9&lt;/p&gt;&lt;p&gt;&amp;#160; if (currentMillis - previousMillis9 &amp;gt;= interval9) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; // save the last pulse time&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; previousMillis9 = currentMillis;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; // if the pin is off turn it on and vice-versa:&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; if (pinState9 == LOW) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; pinState9 = HIGH;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; } else {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; pinState9 = LOW;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; // set the pin with the pinState of the variable:&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; digitalWrite(pulsePin9, pinState9);&lt;/p&gt;&lt;p&gt;&amp;#160; }&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;//Pin8&lt;/p&gt;&lt;p&gt;&amp;#160; if (currentMillis - previousMillis8 &amp;gt;= interval8) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; // save the last pulse time&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; previousMillis8 = currentMillis;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; // if the pin is off turn it on and vice-versa:&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; if (pinState8 == LOW) {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; pinState8 = HIGH;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; } else {&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; pinState8 = LOW;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; // set the pin with the pinState of the variable:&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; digitalWrite(pulsePin8, pinState8);&lt;/p&gt;&lt;p&gt;&amp;#160; }&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;/pre&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;void setup() {&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; pinMode(pulsePin13, OUTPUT);&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; pinMode(pulsePin9, OUTPUT);&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; pinMode(pulsePin8, OUTPUT);&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;void loop() {&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&amp;#160; unsigned long currentMillis = millis();&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;/pre&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;The results are the following:&lt;/p&gt;&lt;p&gt;Pin 8: 50ms - 1m 15s per turn = 0.8RPM = 48RPH&lt;/p&gt;&lt;p&gt;Pin 9: 100ms - 2m 30s per turn = 0.4RPM = 24RPH&lt;/p&gt;&lt;p&gt;(I didn't take the time for 1000ms, it would take ages and I was happy with the consistency of the previous results)&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;This gives us an inversely proportional relation of 40. Therefore, dividing 40 for the required RPM, we can get the interval to set the program to give the required pulses.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;As the drum will normally be set to under 1 RPM, seeing such small RPM values might be awkward so I am using RPH "Rotation per Hour".&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;At this stage will limit the range to be set from 1 RPH to 60 RPH (1 RPM). I don't need anything faster than 1 RPM but I might want to try the &lt;a class="jive-link-profile-small jiveTT-hover-user" data-containerId="-1" data-containerType="-1" data-objectId="302646" data-objectType="3" href="https://www.element14.com/community/people/balearicdynamics"&gt;balearicdynamics&lt;/a&gt; suggestion injecting more gravity to the plants in the future. I am not sure about the results but it sounds fun.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Maybe in the future, we could also have a database with the best turning speed for the different group of plants so it can be easily set once we start a new cycle.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Below is a table with some values relating RPM, RPH and pulse interval.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;table border="1px" cellpadding="0" cellspacing="0" height="300" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#3D3D3D&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;NaN&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#505050&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#F2F2F2&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;6&amp;quot;}" style="border-width: 1px; border-style: solid; width: 265px; height: 300px;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="xl63" height="20" style="border:1pxpx solid black;border-style: solid;border-width: 1px;" width="64"&gt;RPM&lt;/td&gt;&lt;td class="xl63" style="border:1pxpx solid black;border-style: solid;border-width: 1px;" width="104"&gt;RPH&lt;/td&gt;&lt;td class="xl63" style="border:1pxpx solid black;border-style: solid;border-width: 1px;width: 129px;" width="64"&gt;Pulse Interval (ms)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="xl63" height="20" style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;0.0167&lt;/td&gt;&lt;td class="xl63" style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;1&lt;/td&gt;&lt;td class="xl63" style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;2400&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="xl63" height="20" style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;0.0333&lt;/td&gt;&lt;td class="xl63" style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;2&lt;/td&gt;&lt;td class="xl63" style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;1200&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="xl63" height="20" style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;0.1&lt;/td&gt;&lt;td class="xl63" style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;6&lt;/td&gt;&lt;td class="xl63" style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;400&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="xl63" height="20" style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;0.1667&lt;/td&gt;&lt;td class="xl63" style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;10&lt;/td&gt;&lt;td class="xl63" style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;240&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="xl63" height="20" style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;0.4&lt;/td&gt;&lt;td class="xl63" style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;24&lt;/td&gt;&lt;td class="xl63" style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;100&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 23px;"&gt;&lt;td style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;0.8&lt;/td&gt;&lt;td style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;48&lt;/td&gt;&lt;td style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;50&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 32px;"&gt;&lt;td style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;1&lt;/td&gt;&lt;td style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;60&lt;/td&gt;&lt;td style="border:1pxpx solid black;border-style: solid;border-width: 1px;"&gt;40&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;As we are going to inform the desired RPH through MQTT. Once we get the RPH value we need to calculate the Pulse Interval as following.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Pulse Interval = 2400/RPH&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;After all the boring stuff you can relax having a glimpse of the drum turning at 0.8 RPM or 48 RPH&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;img class="jive_macro jive_macro_videomacro"/&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:5a7a42dd-de7e-4d58-8249-9777ce7f0bfb] --&gt;</description>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">washing_machine</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">hydroponics</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">stepper motor</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">intel edison</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycle_it</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">rotary_growing_system</category>
      <pubDate>Mon, 05 Jun 2017 00:38:26 GMT</pubDate>
      <author>messages@element14.com</author>
      <guid>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/05/upcycle-it-washing-machine-hydroponic-grower-7-drum-rpm-calculation</guid>
      <dc:date>2017-06-05T00:38:26Z</dc:date>
      <clearspace:dateToText>1 month ago</clearspace:dateToText>
      <clearspace:replyCount>5</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
      <wfw:comment>https://www.element14.com/community/community/design-challenges/upcycleit/blog/comment/upcycle-it-washing-machine-hydroponic-grower-7-drum-rpm-calculation</wfw:comment>
      <wfw:commentRss>https://www.element14.com/community/community/design-challenges/upcycleit/blog/feeds/comments?blogPost=25562</wfw:commentRss>
    </item>
    <item>
      <title>[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #11: One of its kind!</title>
      <link>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/04/upcycle-it-design-challenge-embedded-web-sdr-client-on-analog-radio-receiver-11-one-of-its-kind</link>
      <description>&lt;!-- [DocumentBodyStart:3012f268-12fb-4ac5-bc7c-647f445618b3] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;&lt;strong&gt;Upcycle finished! The Hybrid Radio is ready&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;I published the first draft pic as a comment to my last post #10. Here is a better one.&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25637-419960/intro1.JPG"&gt;&lt;img alt="intro1.JPG" class="image-1 jive-image" height="899" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25637-419960/1200-899/intro1.JPG" style="width: 620px; height: 465px;" width="1200"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25637-419988/intro21.jpg"&gt;&lt;img alt="intro21.jpg" class="image-16 jive-image" height="331" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25637-419988/397-331/intro21.jpg" style="width:397px; height: 331.449px;" width="397"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;This is my last post for the Upcycle-it Challenge,&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;During the last week of the project everything had to go according to plan. On Friday, June 2nd&amp;#160; noon time,&amp;#160; I had an almost finished radio that still needed some finishing touches, but it was working.&lt;/p&gt;&lt;p&gt;While I was in the process of preparing it and the software&amp;#160; ready, more ideas and features came to my mind. Things that if you do not have something up and running to familiarize yourself with, you cannot even think of.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;We live in the IoT era and experiment with it. I am not sure what the next leap will be. One thing is sure, I have come a long way from my first Intel 8080 and the ARPANET of the 300/75 bps modems to our wifi super fast society. I decided to participate in this Challenge as I wanted to experiment with new ideas. Intel Edison proved to be quite an interesting and powerful platform. As I have another board I am thinking to use for an upgraded version of the Web SDR Analog Radio Client.&lt;/p&gt;&lt;p&gt;It would be really nice if a friend or fellow Ham&amp;#160; could share directly with you an interesting or rare reception the moment it takes place, and you could listen to it on your hardware right away.&lt;/p&gt;&lt;p&gt;&lt;span&gt;Web SDR movement expands. Have a look at&amp;#160;&amp;#160; www.sdr.hu, and you can get a taste of it.&amp;#160; Companies like ICOM, specializing in Amateur Radio equipment start using SDR technology in their products. KiwiSDR (&lt;/span&gt;&lt;a class="" href="https://www.element14.com/community/external-link.jspa?url=http%3A%2F%2Fkiwisdr.com%2FKiwiSDR%2F"&gt;http://kiwisdr.com/KiwiSDR/&lt;/a&gt;&lt;span&gt;) lets you build a Wideband Web SDR server with a BeagleBone Black. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;Although I have accomplished my task for my 1978 Panasonic vintage receiver, I want to&amp;#160; continue my experimentation. There are plenty of vintage receivers to Upcycle, adding various flavors to them.&lt;/p&gt;&lt;p&gt;The idea with the OLED display and the building block from Sparkfun gave me the smallest possible footprint, but for the next project, I would opt for a larger screen.&lt;/p&gt;&lt;p&gt;Tuning to the same station both from my location through the analog portion of my receiver and the Web SDR portion of my Intel Edison I can compare the reception conditions of the same broadcasting transmission at two different locations in one panel and come with useful observations about Wave Propagation, just to name one important feature.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Wrapping the Panasonic receiver&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Well, before wrapping it up, I had to open my receiver, carefully remove the antenna wire and the battery connections and put away the back comer. Then I removed the power supply, the speaker, the logo name plate and eventually the speaker metal front grill.&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25637-419962/op1.jpg"&gt;&lt;img alt="op1.jpg" class="image-3 jive-image" height="337" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25637-419962/190-337/op1.jpg" style="width:190px; height: 337.388px;" width="190"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25637-419963/111.jpg"&gt;&lt;img alt="111.jpg" class="image-4 jive-image" height="335" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25637-419963/593-335/111.jpg" style="width:593px; height: 334.758px;" width="593"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25637-419964/op2.jpg"&gt;&lt;img alt="op2.jpg" class="image-5 jive-image" height="335" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25637-419964/189-335/op2.jpg" style="width:189px; height: 335.281px;" width="189"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25637-419965/op3.jpg"&gt;&lt;img alt="op3.jpg" class="image-6 jive-image" height="339" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25637-419965/191-339/op3.jpg" style="width:191px; height: 339.164px;" width="191"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25637-419966/op4.jpg"&gt;&lt;img alt="op4.jpg" class="image-7 jive-image" height="339" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25637-419966/602-339/op4.jpg" style="width:602px; height: 338.868px;" width="602"/&gt;&lt;/a&gt; Getting ready to be recycled/&lt;/p&gt;&lt;p&gt;I decided to use a plexiglass front plate from a scrapped device that was a short of magnifying glass as well.&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25637-419967/op55.jpg"&gt;&lt;img alt="op55.jpg" class="image-8 jive-image" height="162" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25637-419967/289-162/op55.jpg" style="width:289px; height: 162.213px;" width="289"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I mounted the Edison block on it with four screws. The most difficult part was to find a knob for the joystick button. All the possible places that I visited had knobs that had a larger square diameter than the one that was needed which was 2.2 mm. That was a problem. I should have thought of it earlier, but I was always under the impression that shops that sold such joystick buttons, would also have the right knob for it. As that was not true, I thought that I could print a 3d button from the local 3dhub print shops, but I needed the file in the right format for it. Delivery was next day, so I was still withing my plan. But I did not find such file. I contacted Sparkfun&amp;#8217;s support, but they only had the pdf file of the switch that I had in the meantime traced (SF303GJ26-3).&lt;/p&gt;&lt;p&gt;So I decided to make one myself with the help of a friend that is more experienced on such mechanical tasks. The plastic axle of an Alps potentiometer was used for the purpose, as it had a small hole in the center. It was cut in the right length and the hole was enlarged to 2,2 mm so that it could be fit on the joystick. It was successfully fitted by 03:15 on Thursday morning and to mark the occasion we named our effort as the Midnight project.&lt;/p&gt;&lt;p&gt;We also had to change the two buttons on the OLED board, with ones that had longer axle, but that less difficult. We then cut a conical hole on the plexiglass for the joystick button and by 06:30 on Friday morning the Midnight project was over. During that time we also had to cut and bend the grill, fit a new 2 gang push button change-over switch and put everything together using simple tools. It was a great experience for me.&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25637-419968/op661.jpg"&gt;&lt;img alt="op661.jpg" class="image-9 jive-image" height="194" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25637-419968/194-194/op661.jpg" style="height: 194px; width: 194px;" width="194"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25637-419969/222.jpg"&gt;&lt;img alt="222.jpg" class="image-10 jive-image" height="322" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25637-419969/429-322/222.jpg" style="width:429px; height: 321.975px;" width="429"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25637-419970/op77.jpg"&gt;&lt;img alt="op77.jpg" class="image-11 jive-image" height="292" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25637-419970/390-292/op77.jpg" style="width:390px; height: 292.274px;" width="390"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25637-419971/op99.jpg"&gt;&lt;img alt="op99.jpg" class="image-12 jive-image" height="220" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25637-419971/293-220/op99.jpg" style="width:293px; height: 219.572px;" width="293"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25637-419975/P1040451.JPG"&gt;&lt;img alt="P1040451.JPG" class="image-13 jive-image" height="439" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25637-419975/585-439/P1040451.JPG" style=" width: 585.333px;" width="585"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;After some hours sleep, I had to make a small LM317 regulator board that would power the Edison with 4 volts, to be on the safe side, make the Audio and power connections and put everything back hoping that it would work.&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25637-419976/P1040452.JPG"&gt;&lt;img alt="P1040452.JPG" class="image-14 jive-image" height="414" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25637-419976/552-414/P1040452.JPG" style="width: 552px; height: 414px;" width="552"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25637-419977/P1040455.JPG"&gt;&lt;img alt="P1040455.JPG" class="image-15 jive-image" height="520" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25637-419977/390-520/P1040455.JPG" style="width: 390px; height: 520px;" width="390"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;That &amp;ldquo;easy&amp;#8221; task took time to complete, as the schematics that I had found did not correspond to the pcb&amp;#8217;s of my radio, but with patience everything was gradually resolved and I&amp;#160; ended up with a working radio, a dual mode Hybrid, Web SDR &amp;amp; Analog Receiver. One of its kind if you really think of it. It combined all kind of technologies. A mechanical frequency dial, a switchable frequency counter and a Web SDR client with an OLED display powered by an Intel Edison. The 1978 receiver had been Upcycled to modern standards.&lt;/p&gt;&lt;p&gt;I was the proud and happy owner of it. Panasonic DR-28/ MK-I.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;The last part of the software&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;In my last post, I had stopped with a version of the software that did not include and display on the screen. So I had to add the methods of displaying the Client commands on the screen.&lt;/p&gt;&lt;p&gt;While doing that, I had to adapt a basic concept of the client which was the number of frequency steps to match with the Web SDR server. Three frequency steps are provided. big (+++), medium (++) and small (+), which work cyclically with the Left and Right buttons of the Joystick.&amp;#160; They correspond to&amp;#160; +:0.1kHZ, ++:1kHz, +++:2.5/9kHz depending on the Mode.&lt;/p&gt;&lt;p&gt;Big frequency change is accomplished from the two separate Band switches (A and B) of the OLED module. My assigned bands are:&amp;#160; LW, MW, 160m, 80m, 40m, 30m, 20m, 18m, 15m, 12m, 10m.&lt;/p&gt;&lt;p&gt;Mode (demodulation) is controlled from the Joystick&amp;#8217;s center button and is assigned as: CW, LSB, USB, AM, FM, AM-s (Am-Sync).&lt;/p&gt;&lt;p&gt;Assuming that you select LW band where the broadcasts using AM modulation, the Frequency Stepping becomes 9 KHz(+++), 1 KHz(++), 0,1 KHz(+) . As Long Wave has a range of frequencies that expands from 153 KHz to 279 with a spacing of 9 KHz between the stations, even a single step of (+++) would be enough.&lt;/p&gt;&lt;p&gt;The code is listed below:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;!--[CodeBlockStart:79f13a1a-5619-4a9d-a3d8-5e0ea7e789d5][excluded]--&gt;&lt;pre class="c++" name="code"&gt;'use strict';
const CDP = require('chrome-remote-interface');
const mraa = require('mraa');
var edison = require('../node_modules/edison-oled/build/Release/edisonnodeaddon');
var keypress = require('keypress');
var verbose = true;
var delay = 50;
var smallDelay = 10;
var sleepTime = 5000;
/*
screen is 64 X 48
*/
var lcdWidth = edison.LCDWIDTH;
var lcdHeight = edison.LCDHEIGHT;
var oled = new edison.Oled();

function cleanUp() {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.clear(0);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.display();
}

function initOled() {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if(verbose) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; console.log('--setup screen');
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.begin();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.clear(0);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.display();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setFontType(0);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcdWidth = oled.getLCDWidth();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lcdHeight = oled.getLCDHeight();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if(verbose) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; console.log('---width: ' + lcdWidth);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; console.log('---height: '
function printError(message) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; console.log("Err: " + meesage);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; printErrorOled(message);
}

function printErrorOled(message) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.clear(0);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setFontType(1);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setCursor(0, 0);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.print("Error!");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setFontType(0);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setCursor(0, 15)
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.print(message);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.display();
}

CDP((client) =&amp;gt; {

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; function killClient() {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; client.close();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; cleanUp();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var args = process.argv;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if(args.length != 4) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; console.log("Invalid execution: node websdr_controller_edison.js freq mode");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; killClient();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } else {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var MAX_STEP = 3;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var step = 3;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var currentMode = args[3];
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var currentFrequency = parseFloat(args[2]);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; const bands = [153, 522, 1800, 3500, 7000, 10100, 14000, 18068, 21000, 24890, 28000];
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; const bandNames = ['LW', 'MW', '160m', '80m', '40m', '30m', '20m', '18m', '15m', '12m', '10m'];
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; const modes = ['cw', 'lsb', 'usb', 'am', 'fm', 'amsync'];
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; const modeNames = ["CW", "LSB", "USB", "AM", "FM", "AM's"];
+ lcdHeight);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
}
initOled();

function printError(message) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; console.log("Err: " + meesage);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; printErrorOled(message);
}

function printErrorOled(message) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.clear(0);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setFontType(1);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setCursor(0, 0);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.print("Error!");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setFontType(0);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setCursor(0, 15)
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.print(message);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.display();
}

CDP((client) =&amp;gt; {

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; function killClient() {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; client.close();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; cleanUp();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var args = process.argv;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if(args.length != 4) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; console.log("Invalid execution: node websdr_controller_edison.js freq mode");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; killClient();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } else {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var MAX_STEP = 3;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var step = 3;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var currentMode = args[3];
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var currentFrequency = parseFloat(args[2]);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; const bands = [153, 522, 1800, 3500, 7000, 10100, 14000, 18068, 21000, 24890, 28000];
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; const bandNames = ['LW', 'MW', '160m', '80m', '40m', '30m', '20m', '18m', '15m', '12m', '10m'];
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; const modes = ['cw', 'lsb', 'usb', 'am', 'fm', 'amsync'];
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; const modeNames = ["CW", "LSB", "USB", "AM", "FM", "AM's"];
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var currentBand = 0;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var currentModeId = 3;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var btnUp, btnDown, btnLeft, btnRight, btnSelect, btnA, btnB;

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; function debounce(func, wait, immediate) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var timeout;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return function() {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var context = this, args = arguments;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var later = function() {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; timeout = null;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (!immediate) func.apply(context, args);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; };
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var callNow = immediate &amp;amp;&amp;amp; !timeout;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; clearTimeout(timeout);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; timeout = setTimeout(later, wait);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (callNow) func.apply(context, args);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; };
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; };

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; function sleep(ms) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var now = new Date().getTime();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; while(new Date().getTime() &amp;lt; now + ms){ /* do nothing */ }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; function startScreen() {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if(verbose) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; console.log('--show start');
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.clear();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setCursor(9, 0);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.print("EDISON's");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setCursor(0, 11);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.print("Web SDR ON");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setCursor(0, 23);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.print("design by:");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setCursor(3, 35);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setFontType(1);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.print("SV1ONW");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.display();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; function mainScreen(frequency, mode, step, band) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.clear(0);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setFontType(1);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; let firstPartFreq = Math.floor(frequency);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setCursor(calcOffset(firstPartFreq)*8, 0);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.print(firstPartFreq);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // First part of Frequency string
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setCursor(46, 4);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setFontType(0);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; let secondPartFreq = (frequency % 1).toFixed(3).substring(2)
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.print(secondPartFreq);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Second part of Frequency string
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setCursor(0, 15)
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.print("Mode: " + mode);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //AMsync becomes AM's
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setCursor(0, 26);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.print("Band: " + band);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.setCursor(0, 37);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.print("Step: " + step);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; oled.display();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; function calcOffset(num) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if(num &amp;gt; 0 &amp;amp;&amp;amp; num &amp;lt; 10) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return 4;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } else if(num &amp;gt;= 10 &amp;amp;&amp;amp; num &amp;lt; 100) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return 3;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } else if(num &amp;gt;= 100 &amp;amp;&amp;amp; num &amp;lt; 1000) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return 2;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } else if(num &amp;gt;= 1000 &amp;amp;&amp;amp; num &amp;lt; 10000) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return 1;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } else if(num &amp;gt;= 10000) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return 0;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; function initButtons() {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; btnUp = initButton(46, freqUp);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; btnDown = initButton(31, freqDown);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; btnLeft = initButton(15, stepLeft);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; btnRight = initButton(45, stepRight);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; btnSelect = initButton(33, nextMode);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; btnA = initButton(47, bandUp);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; btnB = initButton(32, bandDown);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; function deregisterButtons() {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; btnUp.isrExit();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; btnDown.isrExit();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; btnLeft.isrExit();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; btnRight.isrExit();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; btnSelect.isrExit();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; btnA.isrExit();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; btnB.isrExit();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; function initButton(pinIn, callback) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; let btn = new mraa.Gpio(pinIn);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; btn.dir(mraa.DIR_IN);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; btn.isr(mraa.EDGE_RISING, callback);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return btn;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; function intro() {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; console.log("Frequency down ['j'] / up ['k'].\nStep size down: ['h'] / up ['l'].\nBand down: ['i'], Band up: ['o'].\nC$
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; printStatus();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; function addKeyPressListener() {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // make `process.stdin` begin emitting "keypress" events
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; keypress(process.stdin);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // listen for the "keypress" event
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; process.stdin.on('keypress', keyPressEvent);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; process.stdin.setRawMode(true);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; process.stdin.resume();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; function changeStep(stepIn) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; step = stepIn;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; printStatus();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; function changeFreq(up, step) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var str = up ? '+' : '-';
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; client.send('Runtime.evaluate', {'expression': 'freqstep(' + str + step + '); nominalfreq();'}, (error, response) =&amp;gt; {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if(error) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; console.log(error);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; currentFrequency = response.result.value;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; printStatus();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; });
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //if(verbose)
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; console.log('stepped ' + (up ? 'up' : 'down'));
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; function setFreq(freq) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; client.send('Runtime.evaluate', {'expression': 'setfreq(' + freq + '); nominalfreq();'}, (error, response) =&amp;gt; {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if(error) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; console.log(error);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; currentFrequency = response.result.value;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; printStatus();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; });
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; function setBand(up) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if(up) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; currentBand += 1;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; currentBand = currentBand &amp;gt;= bands.length ? 0 : currentBand;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } else {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; currentBand -= 1;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; currentBand = currentBand &amp;lt; 0 ? bands.length - 1 : currentBand;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; setFreq(bands[currentBand]);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; function setMode(mode) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; client.send('Runtime.evaluate', {'expression': 'set_mode(\'' + mode + '\'); nominalfreq();'}, (error, response$
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if(error) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; console.log(error);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; currentFrequency = response.result.value;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; printStatus();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; });
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; currentMode = mode;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; function queryFrequency() {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; client.send('Runtime.evaluate', {'expression': 'nominalfreq()'}, (error, response) =&amp;gt; {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if(error) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; console.log(error);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; currentFrequency = response.result.value;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; });
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; function printStatus() {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; let currentModeName = modeNames[currentModeId];
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; let currentBandName = bandNames[currentBand];
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; let currentStepStr = step == 1 ? "+" : (step == 2 ? "++" : "+++");
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; console.log('Frequency: ' + parseFloat(currentFrequency).toFixed(3) + 'kHz, Band: ' + currentBandName + ', Mode: ' + c$
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mainScreen(currentFrequency, currentModeName, currentStepStr, currentBandName);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; function keyPressEvent(ch, key) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //console.log('got "keypress"', key);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (key &amp;amp;&amp;amp; key.name == 'k') {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; freqUp();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else if (key &amp;amp;&amp;amp; key.name == 'j') {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; freqDown();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else if(key &amp;amp;&amp;amp; key.name == 'h') {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; stepLeft();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else if(key &amp;amp;&amp;amp; key.name == 'l') {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; stepRight();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else if(key &amp;amp;&amp;amp; key.name == 'o') {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; bandUp();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else if(key &amp;amp;&amp;amp; key.name == 'i') {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; bandDown();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else if(key &amp;amp;&amp;amp; key.name == 'm') {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; nextMode();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //queryFrequency();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else if (key &amp;amp;&amp;amp; key.ctrl &amp;amp;&amp;amp; key.name == 'c') {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; process.stdin.pause();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; killClient();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var freqUp = debounce(function() {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; changeFreq(true, step);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }, smallDelay);

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var freqDown = debounce(function() {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; changeFreq(false, step);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }, smallDelay);

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var stepLeft = debounce(function() {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; step = step - 1;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; step = step &amp;lt; 1 ? MAX_STEP : step;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; changeStep(step);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }, delay);

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var stepRight = debounce(function() {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; step = step + 1;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; step = step &amp;gt; MAX_STEP ? 1 : step;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; changeStep(step);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }, delay);

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var nextMode = debounce(function() {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; currentModeId += 1;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; currentModeId = currentModeId &amp;gt;= modes.length ? 0 : currentModeId;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; currentMode = modes[currentModeId];
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; setMode([currentMode]);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }, delay);

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var bandUp = debounce(function() {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; setBand(true);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }, delay);

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var bandDown = debounce(function() {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; setBand(false);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }, delay);

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; intro();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //addKeyPressListener();

&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; startScreen();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sleep(sleepTime);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if(verbose) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; console.log('--show main screen');
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; setFreq(currentFrequency);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; printStatus();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; initButtons();
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }
}).on('error', (err) =&amp;gt; {
&amp;#160; // cannot connect to the remote endpoint
&amp;#160; printError(err);
});
&lt;/pre&gt;&lt;!--[CodeBlockEnd:79f13a1a-5619-4a9d-a3d8-5e0ea7e789d5]--&gt;&lt;div style="display:none;"&gt;&lt;/div&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Autostart&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;If you want to make the client start automatically when you boot Edison, follow these steps (adapted from Stepanie Moyerman's blog &lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=http%3A%2F%2Fstephaniemoyerman.com%2F%3Fp%3D41" rel="nofollow" target="_blank"&gt;post&lt;/a&gt;):&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Disable the keyboard event listener by commenting out the following line in &lt;code&gt;websdr_controller_edison.js&lt;/code&gt;:&lt;/li&gt;&lt;/ul&gt;&lt;pre class="jive-pre"&gt;&lt;code&gt;. . . intro(); // addKeyPressListener();&amp;#160; &amp;lt;--- (line 330)&amp;#160; startScreen(); sleep(sleepTime); if(verbose) { console.log('--show main screen'); } setFreq(currentFrequency); printStatus(); initButtons(); . . . &lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;Create a shell script in &lt;code&gt;/etc/init.d&lt;/code&gt;, by calling it something like &lt;code&gt;start_websdr.sh&lt;/code&gt; and add the following (make sure you enter the correct path to where you have cloned the client into, and the parameters for the starting script; see above for details):&lt;/li&gt;&lt;/ul&gt;&lt;pre class="jive-pre"&gt;&lt;code&gt;#!/bin/sh&amp;#160; ### BEGIN INIT INFO # Provides:&amp;#160;&amp;#160; start_websdr # Required-Start: # Required-Stop: # Default-Start:&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2 3 4 5 # Default-Stop:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0 1 6 # Short-Description: starts the websdr client ### END INIT INFO cd path_to_where_websdr_client_is_installed ./websdr.sh websdr_server_url start_freq start_mode &lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;Make the script you have just made executable via &lt;code&gt;chmod +x start_websdr.sh&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Finally, make sure the script is executable every time linux boots:&lt;/li&gt;&lt;/ul&gt;&lt;pre class="jive-pre"&gt;&lt;code&gt;$ cd /etc/init.d/ $ update-rc.d start_websdr.sh defaults &lt;/code&gt;&lt;/pre&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;For the latest version of the code, the initialization script and the automation script files, including installation instructions, you can look at the following GitHub link: &lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fwww.google.com%2Furl%3Fq%3Dhttps%253A%252F%252Fgithub.com%252Fsinantie%252Fwebsdr%26sa%3DD%26sntz%3D1%26usg%3DAFQjCNG0IeF_51JRGLpZ8vuC27Vypx68qA" rel="nofollow" target="_blank"&gt;https://github.com/sinantie/websdr&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;The video&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span id="7c92daf2_f017_482b_9a29_8fca70749b26"&gt;&lt;div class="e14-video-container" style="max-width: 520px;"&gt;&lt;div class="e14-video"&gt;&lt;iframe allowfullscreen="" data-htmlsrc="VideoPluginMacro" mozallowfullscreen="" src="//players.brightcove.net/1362235890001/NkxiVJdjx_default/index.html?videoId=5467018197001" webkitallowfullscreen=""&gt;
&lt;/iframe&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Thanks to my colleague and good friend Thanos, SV1IVK, I have a better video now. &lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Credits&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;In closing I would like to thank my wife Roula for her patience during the whole time of the project, my son and fellow Radio Ham Yannis for his great assistance with code development and js, my daughter-in-law Maria for sharing her web experience with me and our family friend George that helped me with the mechanical portion of the portion.&lt;/p&gt;&lt;p&gt;Thank you team.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;table border="1" class="jiveBorder" height="237" style="border: 1px solid #c6c6c6; width: 965px; height: 227px;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;color: #505050;background-color: #f2f2f2;text-align: left;" valign="middle"&gt;&lt;strong&gt;Published Posts&lt;br/&gt;&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="1" style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25184" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/03/28/upcycle-it-design-challenge-embedded-web-sdr-client-on-analog-radio-receiver-1-introduction"&gt;[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #1: Introduction&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25255" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/04/04/upcycle-it-design-challenge-embedded-web-sdr-client-on-analog-radio-receiver-2-software-concept"&gt;[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #2: Software Concept&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25298" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/04/11/upcycle-it-design-challenge-embedded-web-sdr-client-on-analog-radio-receiver-3-meeting-with-edison"&gt;[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #3: Meeting with Edison&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25360" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/04/19/upcycle-it-design-challenge-embedded-web-sdr-client-on-analog-radio-receiver-4-software-challenges-with-edison"&gt;[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #4: Software Challenges with Edison&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25403" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/04/26/upcycle-it-design-challenge-embedded-web-sdr-client-on-analog-radio-receiver-5-the-software-challenge-goes-on"&gt;[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #5: The Software Challenge goes on&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25448" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/05/03/upcycle-it-design-challenge-embedded-web-sdr-client-on-analog-radio-receiver-6-changing-the-display"&gt;[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #6: Changing the Display&lt;br/&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25481" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/05/10/upcycle-it-design-challenge-embedded-web-sdr-client-on-analog-radio-receiver-7-hardware-is-ready"&gt;[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #7: Hardware is ready!&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25510" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/05/16/upcycle-it-design-challenge-embedded-web-sdr-client-on-analog-radio-receiver-8-hardware-is-ready"&gt;[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #8: Problem with Audio.&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25557" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/05/23/upcycle-it-design-challenge-embedded-web-sdr-client-on-analog-radio-receiver-9-problem-with-browser"&gt;[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #9: Problem with Browser&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25599" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/05/29/upcycle-it-design-challenge-embedded-web-sdr-client-on-analog-radio-receiver-10-making-the-web-sdr-client-work"&gt;[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #10: Making the Web SDR Client work!&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25637" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/04/upcycle-it-design-challenge-embedded-web-sdr-client-on-analog-radio-receiver-11-one-of-its-kind"&gt;[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #11: One of its kind!&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:3012f268-12fb-4ac5-bc7c-647f445618b3] --&gt;</description>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">web sdr</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycled_sdr</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">on analog radio</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">project finished</category>
      <pubDate>Sun, 04 Jun 2017 20:43:27 GMT</pubDate>
      <author>messages@element14.com</author>
      <guid>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/04/upcycle-it-design-challenge-embedded-web-sdr-client-on-analog-radio-receiver-11-one-of-its-kind</guid>
      <dc:date>2017-06-04T20:43:27Z</dc:date>
      <clearspace:dateToText>1 month 6 days ago</clearspace:dateToText>
      <clearspace:replyCount>4</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
      <wfw:comment>https://www.element14.com/community/community/design-challenges/upcycleit/blog/comment/upcycle-it-design-challenge-embedded-web-sdr-client-on-analog-radio-receiver-11-one-of-its-kind</wfw:comment>
      <wfw:commentRss>https://www.element14.com/community/community/design-challenges/upcycleit/blog/feeds/comments?blogPost=25637</wfw:commentRss>
    </item>
    <item>
      <title>UpCycle IT - R2I - BackONTrack</title>
      <link>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/04/upcycle-it-r2i-backontrack</link>
      <description>&lt;!-- [DocumentBodyStart:a523e339-231a-4f52-b938-54589d6b3f9a] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25631" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/04/upcycle-it-r2i-hot2not"&gt;UpCycle IT - R2I - Hot2Not&lt;/a&gt;&lt;/p&gt;&lt;p style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;span style="font-weight: inherit; font-family: inherit; font-style: inherit;"&gt;&lt;em&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-family: Verdana, sans-serif; color: #1f497d;"&gt;UpCycle IT &amp;#8211; R2I INDEX&lt;/span&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-family: Verdana, sans-serif;"&gt;:&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;table border="0" cellpadding="0" cellspacing="0" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#3D3D3D&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;0&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#505050&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#F2F2F2&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;6&amp;quot;}" style="border-width: 0px; border-style: solid; border-color: #ffffff; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;tbody style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-color: #ffffff;border-style: solid;border-width: 0px;border: 0px;background-position: initial;font-family: inherit;font-style: inherit;border: 0px solid #ffffff;padding: 0 5.75pt;" valign="bottom"&gt;&lt;table border="0" cellpadding="0" cellspacing="0" style="border-width: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;tbody style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;p style="margin-bottom: 0.0001pt; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit; color: #007fac;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25159" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/03/24/upcycle-it-r2i-1-introduction"&gt;Blog #1_&amp;#8221;Introduction&amp;#8221;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;p style="margin-bottom: 0.0001pt; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit; color: #007fac;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25205" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/03/30/upcycle-it-r2i-2-designing"&gt;Blog #2_&amp;#8221;Designing&amp;#8221;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;p style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25287" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/04/09/upcycle-it-r2i-3-the-kit"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;Blog #3 "The Kit&lt;/span&gt;"&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25335" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/04/15/upcycle-it-r2i-mother-natures-version"&gt;Blog #4_"Mother Natures Version"&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25383" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/04/23/upcycle-it-r2i-research"&gt;Blog #5_"Research"&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25395" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/04/25/upcycle-it-r2i-competition01"&gt;Blog #6_"Competition01"&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;p style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25444" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/05/02/upcycle-it-r2i-edison-setup"&gt;Blog #7_"Edison Setup"&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25619" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/01/upcycle-it-r2i-edison-link-to-arduino"&gt;Blog #8_"Edison 2 Ardunio"&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25624" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/02/upcycle-it-r2i-grove-on"&gt;Blog #9_"Grove-ON"&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25631" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/04/upcycle-it-r2i-hot2not"&gt;Blog #10_"Hot2Not"&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25632" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/04/upcycle-it-r2i-backontrack"&gt;Blog #11_"BackONTrack"&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;span style="font-weight: inherit; font-size: 18.6667px; font-family: inherit; font-style: inherit;"&gt;&lt;strong&gt;Blog #11 - BackONTrack&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Ah good times!&amp;#160; Sometimes you can be stuck on a single problem for days and days, other times you can be so lucky as to come across&amp;#160; a simple fix that has you back working in just a few hours!&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Today was one of the good days.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;In my last blog I was feeling a little down because while I had success with the Temperature sensor, the LCD RGB Backlight didn't work and I was concerned it would take some modifying to get it doing what it should.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25632-419807/blog11_baseshield.png"&gt;&lt;img alt="blog11_baseshield.png" class="image-1 jive-image" height="363" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25632-419807/blog11_baseshield.png" style="height: auto;" width="458"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Instead some more research showed me that I had not been as aware of the features of the Base Shield as I should have been.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;In the yellow circle you will see a little switch for going from 3.3 V to 5V.&amp;#160; By default it was set for 3.3V.&amp;#160; This allowed my Temperature Sensor to function (although due to the math being based on 5v it was not correct) but my LCD would not.&amp;#160; Switching this over to 5V quickly changed the situation to R2I being Back On Track!&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25632-419808/blog10_LCDdisplayHelloWorld.png"&gt;&lt;img alt="blog10_LCDdisplayHelloWorld.png" class="image-2 jive-image" height="681" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25632-419808/blog10_LCDdisplayHelloWorld.png" style="height: auto;" width="528"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Okay, let's try that Hello World example again!&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25632-419809/blog11_01.png"&gt;&lt;img alt="blog11_01.png" class="image-3 jive-image" height="362" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25632-419809/blog11_01.png" style="height: auto;" width="458"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://triplefacepalm.files.wordpress.com/2011/12/austin-powers-yeah-baby-yeah.jpg"&gt;&lt;img alt="austin-powers-yeah-baby-yeah.jpg" class="image-4 jive-image" src="https://triplefacepalm.files.wordpress.com/2011/12/austin-powers-yeah-baby-yeah.jpg" style="height: auto;"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;I have to agree with Mr. Powers on this one!!!&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Okay, so we have our LCD working!&amp;#160; But Hello World really isn't going to do much for the R2I project, so time to modify a little of that example code and come up with something better for this purpose!&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;/* Hello World and Grove Temperature Sensor sketches modified for use&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160; in displaying temperature to lcd.&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;*/&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;#include &amp;lt;Wire.h&amp;gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;#include "rgb_lcd.h"&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;rgb_lcd lcd;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;const int colorR = 0;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;const int colorG = 0;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;const int colorB = 255;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //BLUE&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;const int pinTemp = A0;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Temp&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;const int B = 3975;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Temp&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;void setup() &lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;{&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Serial.begin(9600);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Temp&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160; &lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; // set up the LCD's number of columns and rows:&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; lcd.begin(16, 2);&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; lcd.setRGB(colorR, colorG, colorB);&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; // Print a message to the LCD.&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; lcd.print("E14-R2I Project");&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; delay(1000);&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;}&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;void loop() &lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;{&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int val = analogRead(pinTemp);&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; float resistance = (float)(1023-val)*10000/val;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; float temperature = 1/(log(resistance/10000)/B+1/298.15)-273.15;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; float ftemp = temperature * (9.0/5.0) + 32.0;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; // set the cursor to column 0, line 1&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; // (note: line 1 is the second row, since counting begins with 0):&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; lcd.setCursor(0, 1);&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; // print the number of seconds since reset:&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; lcd.print(ftemp);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //TEMP&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; delay(100);&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;}&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;/*********************************************************************************************************&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160; END FILE&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;*********************************************************************************************************/&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;Combining elements from the Temperature sketch and the Hello World sketch and changing Hello World to blue E14-R2I Project brings the LCD to a much nicer look for what I want.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25632-419810/blog11_02.png"&gt;&lt;img alt="blog11_02.png" class="image-5 jive-image" height="646" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25632-419810/blog11_02.png" style="height: auto;" width="486"/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;I used Green to highlight the key spots, there are a few more changes not displayed due to size of picture, but it is the main part.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;So let's see what this Sketch will give us now!&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25632-419811/blog11_03.png"&gt;&lt;img alt="blog11_03.png" class="image-6 jive-image" height="311" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25632-419811/blog11_03.png" style="height: auto;" width="441"/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;Yes I definitely like this better!&amp;#160; I had turned on my space heater as well so the combination of the heater right below my work area as well as using the correct voltage brings a tad more understandable temperatures into view.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;Deciding to play with a little more code and the Grove LED option, I added a section that would check and see if the temperature was between a certain range and turn on the LED if it is.&amp;#160; &lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;The idea with this was a quick way to display how the temperature sensor will pickup changes and the LED will display a range of interest.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;This can later be applied with the Relay and the heat element to keep the incubator at a programmed temperature and not too cold or too hot.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;Here is my Temp2LCD2LED Sketch:&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;/* Hello World and Grove Temperature Sensor sketches modified for use&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160; in displaying temperature to lcd.&amp;#160; LED activated if TEMP is in a &lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160; range to simulate heat element for R2I project&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;*/&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;#include &amp;lt;Wire.h&amp;gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;#include "rgb_lcd.h"&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;rgb_lcd lcd;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;const int colorR = 0;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;const int colorG = 0;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;const int colorB = 255;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //BLUE&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;const int pinTemp = A0;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Temp&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;const int B = 3975;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Temp&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;const int pinLed&amp;#160;&amp;#160;&amp;#160; = 3;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //LED&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;void setup() &lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;{&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Serial.begin(9600);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Temp&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; pinMode(pinLed, OUTPUT);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //LED&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160; &lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; // set up the LCD's number of columns and rows:&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; lcd.begin(16, 2);&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; lcd.setRGB(colorR, colorG, colorB);&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; // Print a message to the LCD.&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; lcd.print("E14-R2I Project");&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; delay(1000);&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;}&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;void loop() &lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;{&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int val = analogRead(pinTemp);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="font-size: 8pt;"&gt;&lt;em&gt;//Temp&lt;/em&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; float resistance = (float)(1023-val)*10000/val;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="font-size: 8pt;"&gt;&lt;em&gt;//Temp&lt;/em&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; float temperature = 1/(log(resistance/10000)/B+1/298.15)-273.15;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="font-size: 8pt;"&gt;&lt;em&gt;//Temp&lt;/em&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; float ftemp = temperature * (9.0/5.0) + 32.0;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="font-size: 8pt;"&gt;&lt;em&gt;//Temp&lt;/em&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; if ((ftemp &amp;gt; 79) and (ftemp &amp;lt; 90)) digitalWrite(pinLed, HIGH);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //LED&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; if ((ftemp &amp;lt; 80) or (ftemp &amp;gt; 89)) digitalWrite(pinLed, LOW);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //LED &lt;/em&gt;&lt;/span&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160; &lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160; &lt;/em&gt;&lt;/span&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; // set the cursor to column 0, line 1&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; // (note: line 1 is the second row, since counting begins with 0):&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; lcd.setCursor(0, 1);&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; // print the number of seconds since reset:&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; lcd.print(ftemp);&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; delay(100);&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;}&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;/*********************************************************************************************************&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;&amp;#160; END FILE&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;*********************************************************************************************************/&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;So key parts now are we are watching for Temp to be less than 80 and the LED is unlit.&amp;#160; More than 89 and the LED is unlit.&amp;#160; But if the temp is between 80 &amp;amp; 89 the LED will illuminate.&amp;#160; Easily allowing us to imagine where instead I would require the heat to come on if the temperature is too low and shut off at a certain point.&amp;#160; That is a simpler piece of logic but I wanted to show the Sensor off with the LED.&amp;#160; :-)&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25632-419812/blog11_04.png"&gt;&lt;img alt="blog11_04.png" class="image-7 jive-image" height="444" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25632-419812/blog11_04.png" style="height: auto;" width="540"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Here we can see the temperature is below 80 so the LED is unlit.&amp;#160; Yes I know, in the incubator now I would actually want to be applying heat, but this is for demonstration purposes.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25632-419813/blog11_05.png"&gt;&lt;img alt="blog11_05.png" class="image-8 jive-image" height="455" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25632-419813/blog11_05.png" style="height: auto;" width="540"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Now the temperature is greater than 80 and the LED is illuminating.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25632-419814/blog11_06.png"&gt;&lt;img alt="blog11_06.png" class="image-9 jive-image" height="455" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25632-419814/blog11_06.png" style="height: auto;" width="585"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;And here we have exceeded the 89 degree limit and the LED has went to an unlit state.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;What I will end up doing later is implementing the LED as an external display of when the heat is on or off.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;So far so good!&amp;#160; More to come!&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:a523e339-231a-4f52-b938-54589d6b3f9a] --&gt;</description>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycle it</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycle it design challenge</category>
      <pubDate>Sun, 04 Jun 2017 07:09:00 GMT</pubDate>
      <author>messages@element14.com</author>
      <guid>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/04/upcycle-it-r2i-backontrack</guid>
      <dc:date>2017-06-04T07:09:00Z</dc:date>
      <clearspace:dateToText>1 month 2 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
      <wfw:comment>https://www.element14.com/community/community/design-challenges/upcycleit/blog/comment/upcycle-it-r2i-backontrack</wfw:comment>
      <wfw:commentRss>https://www.element14.com/community/community/design-challenges/upcycleit/blog/feeds/comments?blogPost=25632</wfw:commentRss>
    </item>
    <item>
      <title>UpCycle IT - R2I - Hot2Not</title>
      <link>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/04/upcycle-it-r2i-hot2not</link>
      <description>&lt;!-- [DocumentBodyStart:517738b1-f218-493b-a3ec-f1996281281f] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;h1 style="font-weight: normal; font-style: inherit; font-size: 26px; font-family: inherit;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25624" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/02/upcycle-it-r2i-grove-on"&gt;UpCycle IT - R2I - Grove-ON!&lt;/a&gt;&lt;/h1&gt;&lt;p style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;span style="font-weight: inherit; font-family: inherit; font-style: inherit;"&gt;&lt;em&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-family: Verdana, sans-serif; color: #1f497d;"&gt;UpCycle IT &amp;#8211; R2I INDEX&lt;/span&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-family: Verdana, sans-serif;"&gt;:&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;table border="0" cellpadding="0" cellspacing="0" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#3D3D3D&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;0&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#505050&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#F2F2F2&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;6&amp;quot;}" style="border-width: 0px; border-style: solid; border-color: #ffffff; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;tbody style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-color: #ffffff;border-style: solid;border-width: 0px;border: 0px;background-position: initial;font-family: inherit;font-style: inherit;border: 0px solid #ffffff;padding: 0 5.75pt;" valign="bottom"&gt;&lt;table border="0" cellpadding="0" cellspacing="0" style="border-width: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;tbody style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;p style="margin-bottom: 0.0001pt; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit; color: #007fac;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25159" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/03/24/upcycle-it-r2i-1-introduction"&gt;Blog #1_&amp;#8221;Introduction&amp;#8221;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;p style="margin-bottom: 0.0001pt; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit; color: #007fac;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25205" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/03/30/upcycle-it-r2i-2-designing"&gt;Blog #2_&amp;#8221;Designing&amp;#8221;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;p style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25287" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/04/09/upcycle-it-r2i-3-the-kit"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;Blog #3 "The Kit&lt;/span&gt;"&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25335" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/04/15/upcycle-it-r2i-mother-natures-version"&gt;Blog #4_"Mother Natures Version"&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25383" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/04/23/upcycle-it-r2i-research"&gt;Blog #5_"Research"&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25395" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/04/25/upcycle-it-r2i-competition01"&gt;Blog #6_"Competition01"&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;p style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25444" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/05/02/upcycle-it-r2i-edison-setup"&gt;Blog #7_"Edison Setup"&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25619" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/01/upcycle-it-r2i-edison-link-to-arduino"&gt;Blog #8_"Edison 2 Ardunio"&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25624" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/02/upcycle-it-r2i-grove-on"&gt;Blog #9_"Grove-ON"&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;td style="border:0px solid black;border-width: 0px;border: 0px;font-family: inherit;font-style: inherit;border: 0px solid black;padding: 0 5.75pt;" valign="bottom"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25631" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/04/upcycle-it-r2i-hot2not"&gt;Blog #10_"Hot2Not"&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;span style="font-weight: inherit; font-size: 18.6667px; font-family: inherit; font-style: inherit;"&gt;&lt;strong&gt;Blog #10 - Hot2Not&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: inherit;"&gt;As I had mentioned in blog #9 I am interesting in getting the temperature sensor and the lcd display rolling together since it seems a great duo to work with my project.&amp;#160; Let's see how well they play together with the Intel Edison!&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: inherit;"&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25631-419690/blog10_baseshield.png"&gt;&lt;img alt="blog10_baseshield.png" class="image-1 jive-image" height="363" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25631-419690/blog10_baseshield.png" style="height: auto;" width="458"/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: inherit;"&gt;The Base shield is pretty straight forward, with the pin layout it can only appropriately fit one way to the Intel Edison board.&amp;#160; &lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;span style="font-size: 14pt; font-family: inherit; font-style: inherit;"&gt;&lt;strong&gt;Grove - Temperature Sensor:&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: inherit;"&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25631-419691/blog10_tempfront.png"&gt;&lt;img alt="blog10_tempfront.png" class="image-2 jive-image" height="283" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25631-419691/blog10_tempfront.png" style="height: auto;" width="334"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25631-419692/blog10_tempback.png"&gt;&lt;img alt="blog10_tempback.png" class="image-3 jive-image" height="314" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25631-419692/blog10_tempback.png" style="height: auto;" width="287"/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Here is the Temperature sensor that we will use. &lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25631-419693/blog10_tempinstall.png"&gt;&lt;img alt="blog10_tempinstall.png" class="image-4 jive-image" height="593" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25631-419693/blog10_tempinstall.png" style="height: auto;" width="457"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Going with the suggestion from our Handy/Dandy info page I used the first Analog port, A0 for our temperature sensor.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25631-419695/blog10_tempsketch0.png"&gt;&lt;img alt="blog10_tempsketch0.png" class="image-6 jive-image" height="609" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25631-419695/blog10_tempsketch0.png" style="width: 620px; height: 539px;" width="701"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;In Blog #9 we pulled the Grove Examples into our IDE for our own use.&amp;#160; Here is the Grove_Temperature_Sensor example we will work with.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25631-419694/blog10_tempsketch.png"&gt;&lt;img alt="blog10_tempsketch.png" class="image-5 jive-image" height="593" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25631-419694/blog10_tempsketch.png" style="height: auto;" width="486"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Pretty straight forward, go ahead and upload it over to your Edison.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25631-419696/blog10_tempsketch2.png"&gt;&lt;img alt="blog10_tempsketch2.png" class="image-7 jive-image" height="593" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25631-419696/blog10_tempsketch2.png" style="width: 620px; height: 308px;" width="1193"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Error!!!&amp;#160; Ah, I see that Will Robinson must have switched over to Com8, the Edison does have 2 usb connections and I want to use Com7 for my setup.&amp;#160; So if you get an error you may want to verify you are on the right communications port!&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25631-419697/blog10_tempsketch3UserightComport%21.png"&gt;&lt;img alt="blog10_tempsketch3UserightComport!.png" class="image-8 jive-image" height="593" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25631-419697/blog10_tempsketch3UserightComport%21.png" style="width: 620px; height: 381px;" width="965"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Success!!!&amp;#160; Always the preferred result.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25631-419698/blog10_tempsketchserialmonitor.png"&gt;&lt;img alt="blog10_tempsketchserialmonitor.png" class="image-9 jive-image" height="586" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25631-419698/blog10_tempsketchserialmonitor.png" style="width: 620px; height: 516px;" width="704"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Let's take a look at our Serial Monitor since that is where we will be displaying the Temperature sensor results.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25631-419699/blog10_tempsketch4ConsoleFingertouch0.png"&gt;&lt;img alt="blog10_tempsketch4ConsoleFingertouch0.png" class="image-10 jive-image" height="372" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25631-419699/blog10_tempsketch4ConsoleFingertouch0.png" style="height: auto;" width="391"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Here we have the basic data coming from out Temperature Sensor.&amp;#160; Yes it is a tad chilly in my office.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25631-419700/blog10_tempsketch4ConsoleFingertouch.png"&gt;&lt;img alt="blog10_tempsketch4ConsoleFingertouch.png" class="image-11 jive-image" height="372" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25631-419700/blog10_tempsketch4ConsoleFingertouch.png" style="height: auto;" width="391"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Here I actually cupped the sensor in my hand to provide a little more heat to show it adjusting it's data with temperature change.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25631-419701/blog10_tempsketch4ConsoleFingertouchf.png"&gt;&lt;img alt="blog10_tempsketch4ConsoleFingertouchf.png" class="image-12 jive-image" height="372" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25631-419701/blog10_tempsketch4ConsoleFingertouchf.png" style="height: auto;" width="391"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;To make it easier for my American brain I added a line that took Celsius and converted to Fahrenheit. &lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;// Calculate F temp&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; float ftemp = temperature * (9.0/5.0) + 32.0;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25631-419702/blog10_tempsketch4ConsoleFingertouchfout.png"&gt;&lt;img alt="blog10_tempsketch4ConsoleFingertouchfout.png" class="image-13 jive-image" height="372" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25631-419702/blog10_tempsketch4ConsoleFingertouchfout.png" style="height: auto;" width="391"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Finally to make it cleaner, I added some text to explain exactly what was what.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;// Print the temperature to the serial console.&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; Serial.print("Celcius = ");Serial.println(temperature);&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; Serial.print("Fahrenheit = ");Serial.println(ftemp);&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Okay let's take a look at that LCD Display and hopefully eventually push our Temperature results to the LCD.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 14pt;"&gt;&lt;strong&gt;Grove - RGB Backlight LCD:&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25631-419703/blog10_lcd.png"&gt;&lt;img alt="blog10_lcd.png" class="image-14 jive-image" height="278" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25631-419703/blog10_lcd.png" style="height: auto;" width="458"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Here we go, v4.0 even. &lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25631-419704/blog10_lcdinstall.png"&gt;&lt;img alt="blog10_lcdinstall.png" class="image-15 jive-image" height="459" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25631-419704/blog10_lcdinstall.png" style="width: 620px; height: 349px;" width="816"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Here we have the LCD plugged into the 2nd I2C port per the Handy Dandy info page.&amp;#160; Keeping it simple!&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25631-419705/blog10_LCDdisplayHelloWorld.png"&gt;&lt;img alt="blog10_LCDdisplayHelloWorld.png" class="image-16 jive-image" height="681" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25631-419705/blog10_LCDdisplayHelloWorld.png" style="height: auto;" width="528"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Let's go ahead and load the tried and true favorite, Hello World as an example test.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25631-419706/blog10_LCDdisplaySerial.png"&gt;&lt;img alt="blog10_LCDdisplaySerial.png" class="image-17 jive-image" height="459" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25631-419706/blog10_LCDdisplaySerial.png" style="width: 620px; height: 349px;" width="816"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Hmm, not what I was hoping for.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;I tried several other examples and while it looks like the sketch loads fine the LCD does not actually display the appropriate messages. &lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Looking online I found some references that suggested hardwiring some additional pieces in to resolve this but I want to fully explore Grove first to see if they have updated information.&amp;#160; It seems contrary to their kit idea to have to start throwing additional pieces at their devices that were not included.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;So the Temperature Sensor was a success hence the Hot part of the Title.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Sadly the LCD wasn't, explaining the 2Not part. &lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;I am going to keep researching since the LCD seems a perfect part of the kit to use, so stay tuned!&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:517738b1-f218-493b-a3ec-f1996281281f] --&gt;</description>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycle it</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycle it design challenge</category>
      <pubDate>Sun, 04 Jun 2017 01:47:00 GMT</pubDate>
      <author>messages@element14.com</author>
      <guid>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/04/upcycle-it-r2i-hot2not</guid>
      <dc:date>2017-06-04T01:47:00Z</dc:date>
      <clearspace:dateToText>1 month 2 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
      <wfw:comment>https://www.element14.com/community/community/design-challenges/upcycleit/blog/comment/upcycle-it-r2i-hot2not</wfw:comment>
      <wfw:commentRss>https://www.element14.com/community/community/design-challenges/upcycleit/blog/feeds/comments?blogPost=25631</wfw:commentRss>
    </item>
    <item>
      <title>[Upcycle It] Interactive Race Car Driver - The Checkered Flag</title>
      <link>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/03/upcycle-it-interactive-race-car-driver-final-report</link>
      <description>&lt;!-- [DocumentBodyStart:8b1313ff-1d26-4e48-ac2e-507ca9a4d31d] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;"What will you make?" asked the Intel Edison. The objective of the project was to upcycle an old RC car and a Furby to create an Interactive Race Car Driver using the Intel Edison and scrap or recycled components.&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-418659/2017-02-01+20.18.59.jpg"&gt;&lt;img alt="2017-02-01 20.18.59.jpg" class="image-1 jive-image" height="337" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-418659/253-337/2017-02-01+20.18.59.jpg" style="width:253px; height: 337.46px;" width="253"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-418660/Edison.jpg"&gt;&lt;img alt="Edison.jpg" class="image-2 jive-image" height="340" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-418660/427-340/Edison.jpg" style="width:427px; height: 340.01px;" width="427"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;h2&gt;Car&lt;/h2&gt;&lt;p&gt;One of the key features that attracted me to the car was that it had 4 screws located at the front and back. I knew those would make a good mounting point for a frame to which I could attach my components. The frame was printed using with recycled filament that used to be car dashboards. The screws came from old PCs and keyboards.&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-418666/Before.jpg"&gt;&lt;img alt="Before.jpg" class="image-3 jive-image" height="300" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-418666/400-300/Before.jpg" style="width: 400px; height: 300px;" width="400"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The middle of the car housed the RC module and a container for the original battery pack. I checked if the H-Bridge of the RC module could be reused on a simulator and then in reality. It was designed never to stop so would not work for my project. So that was removed and swapped with an off the shelf module. The middle of the car was cut down and rewired using old PC cables.&lt;br/&gt;Another feature that appealed to me was the 4 wheel drive skid steer setup of the motors. However only 3 of my 4 wheels were working so I had to repair the gearbox. Which I did with some gears from the spares box.&lt;br/&gt;To my frame I attached lights and bumpers, along with a battery box. The lights were upcycled too, a broken downlight was disassembled to extract the LEDs for the headlights. 3mm RED LEDs for brake lights were salvaged from a keyboard, theses have yet to be incorporated into the car.&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-418667/IMG_20170513_183058.jpg"&gt;&lt;img alt="IMG_20170513_183058.jpg" class="image-4 jive-image" height="264" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-418667/245-264/IMG_20170513_183058.jpg" style="width: 244.53px; " width="245"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-418668/IMG_20170512_204700.jpg"&gt;&lt;img alt="IMG_20170512_204700.jpg" class="image-5 jive-image" height="257" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-418668/241-257/IMG_20170512_204700.jpg" style="width:241px; height: 256.93px;" width="241"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-418669/BatteryBox+%281%29.jpg"&gt;&lt;img alt="BatteryBox (1).jpg" class="image-6 jive-image" height="256" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-418669/158-256/BatteryBox+%281%29.jpg" style="width:158px; height: 256.08px;" width="158"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I wanted the Edison to take pride of place so I styled that as the engine with the aid of some 3D printed parts, these were printed using recycled P.E.T. which used to be drink bottles.&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-418671/IMG_20170508_210714.jpg"&gt;&lt;img alt="IMG_20170508_210714.jpg" class="image-8 jive-image" height="376" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-418671/374-376/IMG_20170508_210714.jpg" style=" width: 373.574px;" width="374"/&gt;&lt;/a&gt;&lt;br/&gt;To simplify testing and wiring I used the grove shield and connectors. I put my own sockets on the breakout boards for the motor and lights. The boards I used for the lights were upcycled from some scrapped protoshields with poor quality silk screen that AverageManVsPi sent me last year.&amp;#160; The wiring for these boards was also upcycled where possible using old telephone cables. The bumper was also 3D printed and fitted with microswitches. The switches came from a broken shredder. The car is powered from a phone powerbank which clips onto the back of the car with 3D printed clips. Unfortunately my 3D print broke before I finished printing all the parts but temporary parts have been made from wood.&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-419685/CarCircuit.png"&gt;&lt;img alt="CarCircuit.png" class="image-23 jive-image" height="794" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-419685/CarCircuit.png" style="width: 620px; height: 438px;" width="1123"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;All the 3D models can be found at: &lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FWorkshopshed%2FUpcyclingDesignChallenge" rel="nofollow" target="_blank"&gt;https://github.com/Workshopshed/UpcyclingDesignChallenge&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;h2&gt;Driver&lt;/h2&gt;&lt;p&gt;The main donor component for the driver was a first generation Furby from the 1990s. Like the car this had it's H-Bridge swapped out with an off the shelf module. Also removed were the 2 chip on board modules that used to control the motion and sounds. These were replaced with wires that connected up to the Edison via some simple level shifters. The level shifters were made using more scrap protoshields and some transistors that most likely came from a radio.&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-418672/InsideTheFurby.jpg"&gt;&lt;img alt="InsideTheFurby.jpg" class="image-9 jive-image" height="319" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-418672/240-319/InsideTheFurby.jpg" style="width:240px; height: 319.27px;" width="240"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-418674/IMG_20170521_194900.jpg"&gt;&lt;img alt="IMG_20170521_194900.jpg" class="image-11 jive-image" height="220" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-418674/364-220/IMG_20170521_194900.jpg" style="width:364px; height: 220.31px;" width="364"/&gt;&lt;/a&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-418675/EdisonBatteryAndAudio.jpg"&gt;&lt;img alt="EdisonBatteryAndAudio.jpg" class="image-12 jive-image" height="279" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-418675/329-279/EdisonBatteryAndAudio.jpg" style="width:329px; height: 278.58px;" width="329"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;The Furby's motion is driven from a series of cams. The position of those is sensed with a mechanical home switch and an optical sensor that pulses as the cam rotates. The LED for that sensor was replaced as it did not seem to be working. The output of the sensor went through some conditioning circuity to transistor to shift the signal level down to 1.8v for the Edison. The MCU was programmed to detect the pulses and count them.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;To give the Furby a voice a USB audio card was plugged into the Edison. This was modified to have a micro USB connector. An amplifier module was added to drive the Furby's original speaker.&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-418954/FurbyBlockDiagram.png"&gt;&lt;img alt="FurbyBlockDiagram.png" class="image-13 jive-image" height="557" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-418954/744-557/FurbyBlockDiagram.png" style=" width: 744.267px;" width="744"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I got my daughter to record her best Furby impersonations and these were chopped into segments and copied to the Freddie board.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;h2&gt;Upcycling summary table&lt;/h2&gt;&lt;table border="1" class="jiveBorder" height="460" style="border: 1px solid #c6c6c6; width: 831px; height: 461px;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;color: #505050;background-color: #f2f2f2;text-align: left;" valign="middle"&gt;&lt;strong&gt;Item&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;color: #505050;background-color: #f2f2f2;text-align: left;" valign="middle"&gt;&lt;strong&gt;Origin&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;Radio controlled Car&lt;/td&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;Surplus store sometime in 1995.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;Furby&lt;/td&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;Probably from a toyshop in late 1990s early 2000s.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;Wire&lt;/td&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;p&gt;Telephone Cable&lt;/p&gt;&lt;p&gt;PC Power Cable&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;PCBs&lt;/td&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;Scrapped Protoshield&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;Nuts, Bolts, Screws&lt;/td&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;Decomissioned PCs and broken domestic appliances&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;Microswitches&lt;/td&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;Shredder&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;LEDs&lt;/td&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;p&gt;Headlight LEDs from broken downlighter&lt;/p&gt;&lt;p&gt;Brakelights from computer keyboard&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;Level shifter transistors&lt;/td&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;p&gt;Most likely from an old radio&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;Filament&lt;/td&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;p&gt;ABS recycled from car dashboards&lt;/p&gt;&lt;p&gt;PET recycled from drink bottles&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;Wood&lt;/td&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;p&gt;Sprue from Dollshouse&lt;/p&gt;&lt;p&gt;Offcuts from other projects&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;h2&gt;Software&lt;/h2&gt;&lt;p&gt;Right from the start I decided to standardise on &lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fnodejs.org%2Fen%2F" rel="nofollow" target="_blank"&gt;NodeJS&lt;/a&gt; for the code. I also wanted to be able to control the car from a phone or tablet. I wrote a simple web UI that connected back to the Edison using MQTT over Sockets. This was secured using certificates.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-418955/Software2.png"&gt;&lt;img alt="Software2.png" class="image-14 jive-image" height="380" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-418955/Software2.png" style="width: 620px; height: 370px;" width="637"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-419572/FurbySoftware.png"&gt;&lt;img alt="FurbySoftware.png" class="image-15 jive-image" height="277" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-419572/FurbySoftware.png" style="width: 620px; height: 239px;" width="719"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;To read the signals from the optical sensor, the Furby uses the Edison's MCU and reports that back to the control software allowing the position of the action cam to be known. The Furby also hooks into MQTT too and responds to events from the car.&lt;/p&gt;&lt;div __default_attr="info" alert="info" class="jive_macro_alert jive_text_macro" name="alert"&gt;&lt;p&gt;All the software can be found at: &lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FWorkshopshed%2FUpcyclingDesignChallenge" rel="nofollow" target="_blank"&gt;https://github.com/Workshopshed/UpcyclingDesignChallenge&lt;/a&gt; &lt;/p&gt;&lt;/div&gt;&lt;h2&gt;Car and Driver&lt;/h2&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;table border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid black;border: 1px solid #000000;background-color: #6690bc;color: #ffffff;text-align: center;padding: 2px;" valign="middle"&gt;&lt;strong&gt;{gallery} Closeups&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #000000;padding: 2px;"&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-419676/CarMotorAndLightControl.jpg"&gt;&lt;img alt="CarMotorAndLightControl.jpg" class="image-16 jive-image" height="573" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-419676/430-573/CarMotorAndLightControl.jpg" style="width: 429.75px; " width="430"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Engine Bay: Wiring for lights, bumpers and motors, power converter to right&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #000000;padding: 2px;"&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-419677/CarPower.jpg"&gt;&lt;img alt="CarPower.jpg" class="image-17 jive-image" height="900" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-419677/1200-900/CarPower.jpg" style="width: 620px; height: 465px;" width="1200"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Fuel Tank: The power for the car, the original on/off switch still disconnects the power&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #000000;padding: 2px;"&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-419679/FurbyControlCentral.jpg"&gt;&lt;img alt="FurbyControlCentral.jpg" class="image-18 jive-image" height="900" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-419679/675-900/FurbyControlCentral.jpg" style="width: 620px; height: 827px;" width="675"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Under the seat: Level shifters, audio, power and Edison to control the Furby&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #000000;padding: 2px;"&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-419681/CarEngineTheEdison.jpg"&gt;&lt;img alt="CarEngineTheEdison.jpg" class="image-19 jive-image" height="900" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-419681/675-900/CarEngineTheEdison.jpg" style="width: 620px; height: 827px;" width="675"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Car Engine: The Edison is what powers this beast of a car&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #000000;padding: 2px;"&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-419682/CarAndDriver+%281%29.jpg"&gt;&lt;img alt="CarAndDriver (1).jpg" class="image-20 jive-image" height="900" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-419682/716-900/CarAndDriver+%281%29.jpg" style="width: 620px; height: 779px;" width="716"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Car and Driver: Completed car and driver&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #000000;padding: 2px;"&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-419684/CarAndDriver+%283%29.jpg"&gt;&lt;img alt="CarAndDriver (3).jpg" class="image-22 jive-image" height="900" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-419684/675-900/CarAndDriver+%283%29.jpg" style="width: 620px; height: 827px;" width="675"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Car and Driver: Completed car and driver&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #000000;padding: 2px;"&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25618-419683/CarAndDriver+%282%29.jpg"&gt;&lt;img alt="CarAndDriver (2).jpg" class="image-21 jive-image" height="828" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25618-419683/621-828/CarAndDriver+%282%29.jpg" style="width: 621px; height: 828px;" width="621"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Car and Driver: Completed car and driver&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;h2&gt;Car Demo&lt;/h2&gt;&lt;p&gt;Car test using some simple nodeJS scripts.&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FWorkshopshed%2FUpcyclingDesignChallenge%2Fblob%2Fmaster%2FTests%2FtestCar1.js" rel="nofollow" target="_blank"&gt;Motion test&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FWorkshopshed%2FUpcyclingDesignChallenge%2Fblob%2Fmaster%2FTests%2FtestCar2.js" rel="nofollow" target="_blank"&gt;Light test&lt;/a&gt; &lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span id="c4b11a30_d3ca_4c44_902e_98ab1100d2a3"&gt;&lt;div class="e14-video-container" style="max-width: 520px;"&gt;&lt;div class="e14-video"&gt;&lt;iframe allowfullscreen="" data-htmlsrc="VideoPluginMacro" mozallowfullscreen="" src="//players.brightcove.net/1362235890001/NkxiVJdjx_default/index.html?videoId=5459361191001" webkitallowfullscreen=""&gt;
&lt;/iframe&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;h2&gt;Driver Demo&lt;/h2&gt;&lt;p&gt;Coming Soon&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;h2&gt;Thanks&lt;/h2&gt;&lt;p&gt;Firstly to my family for putting up with 10 weeks of my madness and for their help, feedback and motivation.&lt;/p&gt;&lt;p&gt;Thanks to Intel for the Edisons, sponsoring the challenge and providing a great set of tools, documentation and O/S images.&lt;br/&gt;Element14 for hosting the challenge.&lt;br/&gt;Fellow challenges for their suggestions and ideas.&lt;br/&gt;Previous Furby hackers: Kelly Heaton, Chris Brown and Northwestern University Mechatronics Design Laboratory&lt;br/&gt;Harry Fairhead for his excellent notes on life at 1.8v.&lt;br/&gt;Thomas Stratford and Alan Barnet for identifying my mystery transistors.&lt;br/&gt;Brian and Enrico who offered to print parts when my printer broke.&lt;br/&gt;And to the Element14 and Twitter communities for their encouragement.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:8b1313ff-1d26-4e48-ac2e-507ca9a4d31d] --&gt;</description>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycled_interactiveracecardriver</category>
      <pubDate>Sat, 03 Jun 2017 22:28:50 GMT</pubDate>
      <author>messages@element14.com</author>
      <guid>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/03/upcycle-it-interactive-race-car-driver-final-report</guid>
      <dc:date>2017-06-03T22:28:50Z</dc:date>
      <clearspace:dateToText>1 month 2 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>24</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
      <wfw:comment>https://www.element14.com/community/community/design-challenges/upcycleit/blog/comment/upcycle-it-interactive-race-car-driver-final-report</wfw:comment>
      <wfw:commentRss>https://www.element14.com/community/community/design-challenges/upcycleit/blog/feeds/comments?blogPost=25618</wfw:commentRss>
    </item>
    <item>
      <title>Upcycled Clock – Summary</title>
      <link>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/03/upcycled-clock-summary</link>
      <description>&lt;!-- [DocumentBodyStart:bb05d8a0-cfee-4b02-a15c-a73f8efe32dc] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;The last couple of months have been a lot of fun taking part in the challenge, and here is a quick summary of all the features I was able to implement as part of the challenge. I have managed to achieve most of the features I initially&amp;#160; planned as part of the proposal, with a couple of deviations. And, with the build of the clock and circuit completed, this put me in a good position to add more software features to the clock in the future. Here is an before and after picture side by side&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25625-419449/sidebySide.png"&gt;&lt;img alt="sidebySide.png" class="image-1 jive-image" height="497" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25625-419449/sidebySide.png" style="width: 620px; height: 256px;" width="1205"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 14pt;"&gt;&lt;strong&gt;Features Implemented&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Here are the list of features I have managed to implement using the Intel Edison.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Visual indicator using diffusion panels - &lt;/strong&gt;as part of the build five glass panels were switched out for 3D printed LED diffusion panel, which are meant to give an visual indicator when I wake up in the morning. Here is a brief description of the panels -&lt;ul&gt;&lt;li&gt;Weather - this lights up based on the weather conditions from &lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=http%3A%2F%2Fopenweathermap.org%2F" rel="nofollow" target="_blank"&gt;openweathermap.org&lt;/a&gt;. Yellow for sunny, blue for rainy and white for cloudy.&lt;/li&gt;&lt;li&gt;Traffic &amp;#8211; based on the &lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fdevelopers.google.com%2Fmaps%2Fdocumentation%2Fdistance-matrix%2F" rel="nofollow" target="_blank"&gt;Google Maps Distance Matrix API&lt;/a&gt;, gives me an indicator if I need to leave early because of heavy traffic.&lt;/li&gt;&lt;li&gt;Twitter - this will be set to blue , if the hashtag that I am tracking has been used more that 5 times&amp;#160; in a tweets today on the twittersphere.&lt;/li&gt;&lt;li&gt;Gmail - this panel will light up red, if I have more than 10 unread messages, and green if less than 10.&lt;/li&gt;&lt;li&gt;Home - this panel is to monitor values from the Air quality and Temperature sensors connected to the back of the clock.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Getting more info from the LCD panel&lt;/strong&gt; -&amp;#160; there are two more glass panels that were replaced on the clock to house an Grove LCD and two buttons and a potentiometer, which are used to set alarms, show the weather condition, temperature and humidity outside, and also show temperature and air quality sensor values. In addition, you can also get the IP address assigned to the Intel Edison just in case you have to ssh in for maintenance,&amp;#160; and also switch off/on you phillips-hue smart bulbs at home.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Making the clock Speak in the morning&lt;/strong&gt; - as part of the setup I am using an amplifier and speaker connected to the USB sound card, to read out the weather condition,the latest 5 tweets for a specific hashtag that I am tracking. As part of this feature, I would also like to add the top 5 news headline in a future enhancement.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Uploading sensor data to Cayenne&lt;/strong&gt; - this feature was a great addition to the clock, and was a result of meeting the folks from &lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fmydevices.com%2Fcayenne%2Ffeatures%2F" rel="nofollow" target="_blank"&gt;myDevices&lt;/a&gt; at the Bay Area Makerfaire a couple of weeks ago.Basically as part of this feature, I am uploading the temperature,Light and Air quality sensor to Cayenne IoT dashboard.I have just touched the surface with this, and would like to explore a couple of more features in future.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Make the clock speak after the door is opened (post challenge)&lt;/strong&gt; &amp;#8211; this feature uses an ESP8266 and Magnetic contact switch aka a door sensor to detect the opening of my front door, when I get home from work in the evening. Once the door is opened, the ESP8266 publishes a MQTT message on a topic which the Intel Edison subscribes to, and then reads out the weather condition, temperature at home and tweet with a specific hashtag&lt;/li&gt;&lt;/ul&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 14pt;"&gt;&lt;strong&gt;Electronics and Upcycling the clock&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25625-419450/circuitSidebySide.png"&gt;&lt;img alt="circuitSidebySide.png" class="image-2 jive-image" height="501" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25625-419450/circuitSidebySide.png" style="width: 620px; height: 259px;" width="1197"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Here are the list of sensors used as part of the build, connected to the &lt;a class="jive-link-wiki-small" data-containerId="2533" data-containerType="14" data-objectId="78894" data-objectType="102" href="https://www.element14.com/community/docs/DOC-78894/l/intel-edison-kit-for-arduino?ICID=intel-triptec-link?ICID=featured_search"&gt;Intel Edison Arduino board&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;table border="1" class="jiveBorder" style="border: 1px solid #c6c6c6; width: 100%;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;color: #505050;background-color: #f2f2f2;text-align: left;" valign="middle"&gt;&lt;strong&gt;Pin#&lt;br/&gt;&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;color: #505050;background-color: #f2f2f2;text-align: left;" valign="middle"&gt;&lt;strong&gt;Sensor connected&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;A0&lt;/td&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;Potentiometer which is used to control features on the clock and display things like weather condition, Temperature etc.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;D2&lt;/td&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;Top green button&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;D3&lt;/td&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;Yellow button at the bottom&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;D5&lt;/td&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fwww.seeedstudio.com%2FGrove-Buzzer-p-768.html" rel="nofollow" target="_blank"&gt;Grove buzzer&lt;/a&gt; sensor for sounding the Alarms&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;D11&lt;/td&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;Data line of the &lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fwww.sparkfun.com%2Fproducts%2F14015" rel="nofollow" target="_blank"&gt;LED strip (APA102)&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;D13&lt;/td&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;Clock line of the LED strip&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;A1&lt;/td&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fwww.seeedstudio.com%2FGrove-Air-quality-sensor-v1.3-p-2439.html" rel="nofollow" target="_blank"&gt;Grove Air quality sensor v1.3&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;A2&lt;/td&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fwww.seeedstudio.com%2FGrove-Temperature-Sensor-p-774.html" rel="nofollow" target="_blank"&gt;Grove temperature sensor&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;A3&lt;/td&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fwww.seeedstudio.com%2FGrove-Light-Sensor-p-746.html" rel="nofollow" target="_blank"&gt;Grove Light sensor&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;p&gt;I2C&lt;/p&gt;&lt;p&gt;A4, A5&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;border: 1px solid #c6c6c6;padding: 6px;"&gt;&lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fwww.seeedstudio.com%2FGrove-LCD-RGB-Backlight-p-1643.html" rel="nofollow" target="_blank"&gt;Grove RGB LCD display &lt;/a&gt;connected to the I2C connector on the Grove shield&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;In addition, I am using &lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fwww.adafruit.com%2Fproduct%2F987" rel="nofollow" target="_blank"&gt;Adafruit&amp;#8217;s Stereo 3.7W Class D Audio Amplifier - MAX98306&lt;/a&gt; with a 4 ohms 3 watt speaker connected to the USB sound card, which you see on the left of the picture above. But I should have ideally gone with Adafruit Mono 2.5W Class D Audio Amplifier - PAM8302, since I am using only one speaker,which means I will have to order one later.&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;To power the Intel Edison, I am using the power adapter that came in as part of the kit that is &lt;a class="" href="https://www.element14.com/community/view-product.jspa?fsku=NULL&amp;amp;nsku=85Y2818&amp;amp;COM=noscriptWSX120-2000 AC/DC"&gt;Triad Magnetic Power Supply 1 Output 24 W 12 V,2 A&lt;/a&gt; .&lt;/span&gt;And to power the LED strip I am currently using another &lt;a class="jive-link-external-small" href="http://www.mcmelectronics.com/product/28-21442?utm_campaign=e14&amp;amp;utm_source=e14community&amp;amp;utm_medium=forum&amp;amp;utm_term=28-21442&amp;amp;COM=main-search+COMe14-SOM-YOUTUBE-BENHECK-EP273&amp;amp;CID=COMe14-SOM-YOUTUBE-BENHECK-EP273" target="_blank"&gt;power adapter 5V and 2.5 A.&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;As part of the build,I had to remove the glass panels and replace them with something that would not impact the rustic look and aesthetic of the old clock. So, I set-out and designed the panels in Autodesk Fusion 360 and 3D printed them in &lt;span style="color: #333333; font-family: Verdana, 'Verdana Ref', Geneva, Tahoma, sans-serif;"&gt;&lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fwww.amazon.com%2FSUNLU-Printer-Filament-Dimensional-Accuracy%2Fdp%2FB01NCINDMG%2Fref%3Dsr_1_1%3Fie%3DUTF8%26qid%3D1496520031%26sr%3D8-1-spons%26keywords%3DSunlu%2Bwood%2Bfilament%26psc%3D1" rel="nofollow" target="_blank"&gt;Sunlu wood filament &lt;/a&gt;, which I then sanded and stained using &lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=http%3A%2F%2Fwww.homedepot.com%2Fp%2FMinwax-1-qt-Wood-Finish-Dark-Walnut-Oil-Based-Interior-Stain-70012%2F100376185" rel="nofollow" target="_blank"&gt;Mirmax Wood finish&lt;/a&gt;. And for the LED diffusion parts of the panel were dual 3D printed using Hatchbox transparent PLA, in combination with another matching color PLA.&amp;#160; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.element14.com/community/servlet/JiveServlet/showImage/38-25625-419451/pannelSidebySide.png"&gt;&lt;img alt="pannelSidebySide.png" class="image-3 jive-image" height="436" src="https://www.element14.com/community/servlet/JiveServlet/downloadImage/38-25625-419451/pannelSidebySide.png" style="width: 620px; height: 226px;" width="1197"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 14pt;"&gt;&lt;strong&gt;List of blog posts&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Here are the list of blog posts written as part of the challenge, most of the blog posts which include code also include setup instructions on the Intel Edison which you can tweak to include in your own projects.&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25183" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/03/28/wake-up-to-the-upcycled-clock-"&gt;Upcycled Clock #1&amp;#8211; Project details&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25300" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/04/11/upcycled-clock-3d-printing-parts-to-hold-buttonspot-and-lcd"&gt;Upcycled Clock #2- 3D printing parts to hold buttons, pot and LCD &lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25377" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/04/22/upcycled-clock-showing-ip-address-and-temperature-on-grove-lcd"&gt;Upcycled Clock #3 - Showing IP address and temperature on Grove LCD &lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25397" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/04/28/upcycled-clock-unleash-the-power-using-ifttt"&gt;Upcycled Clock #4 - Unleash the power using IFTTT &lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25426" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/04/30/upcycled-clock-getting-the-weather-using-espeak"&gt;Upcycled Clock #5 - Reading out the weather using eSpeak &lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25460" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/05/06/upcycled-clock-reading-out-tweets-on-bluetooth-speakers"&gt;Upcycled Clock #6- Reading out tweets on a Bluetooth speakers &lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25474" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/05/09/upcycled-clock-testing-the-rgb-led-strip"&gt;Upcycled Clock #7 - Testing the RGB LED strip &lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25491" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/05/13/upcycled-clock-commute-time-to-work-using-google-maps-api"&gt;Upcycled Clock #8- Commute time to work using Google Maps API &lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25517" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/05/18/upcycled-clock-3d-printing-panels"&gt;Upcycled Clock #9 - 3D Printing panels &lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25543" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/05/20/upcycled-clock-3d-printing-led-diffusers-for-the-panels"&gt;Upcycled Clock #10 - 3D Printing LED diffusers for the panels &lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25577" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/05/26/upcycled-clock-posting-sensor-data-to-cayenne"&gt;Upcycled Clock #11- posting sensor data to Cayenne &lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25597" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/05/31/upcycled-clock-soldering-and-more-3d-printing"&gt;Upcycled Clock #12 -Soldering and more 3D printing &lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25612" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/03/upcycled-clock-led-diffusion-panel-integration"&gt;Upcycled Clock #13- LED diffusion panel Integration &lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25616" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/03/upcycled-clock-displaying-data-on-grove-lcd"&gt;Upcycled Clock #14-Display data on the Grove LCD&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-blog-small" data-containerId="15968" data-containerType="37" data-objectId="25683" data-objectType="38" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/14/upcycled-clock-detect-door-opening"&gt;Upcycled Clock #15- Detect door opening (post challenge)&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 14pt;"&gt;&lt;strong&gt;Software&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The code for the project and the blog post above, has been uploaded to Github at&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FCJAndrade%2FUpcycled-Clock%2F" rel="nofollow" target="_blank"&gt;https://github.com/CJAndrade/Upcycled-Clock/&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 14pt;"&gt;&lt;strong&gt;Video Demo&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;div class="e14-video-container" style="max-width: 440px"&gt;&lt;div class="e14-video"&gt;&lt;iframe allowfullscreen="allowfullscreen" frameborder="0" height="330" scrolling="no" src="https://www.youtube.com/embed/ppi0lswSZAk?wmode=transparent" width="440"&gt;
&lt;/iframe&gt;&lt;/div&gt;&lt;/div&gt;&lt;/em&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 14pt;"&gt;&lt;strong&gt;Conclusion &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;In conclusion, I would like to thank element14 and Intel to hosting and sponsoring this awesome challenge. And in addition, I would also like to say a big thank you to all the other challengers and members of the element14 community, who commented on my blog post&amp;#160; with suggestion and positive feedback and &lt;a class="jive-link-profile-small jiveTT-hover-user" data-containerId="-1" data-containerType="-1" data-objectId="124114" data-objectType="3" href="https://www.element14.com/community/people/CharlesGantt"&gt;CharlesGantt&lt;/a&gt; for featuring my updates on the weekly challenge summaries. And a big shout out to &lt;a class="jive-link-profile-small jiveTT-hover-user" data-containerId="-1" data-containerType="-1" data-objectId="358206" data-objectType="3" href="https://www.element14.com/community/people/rscasny"&gt;rscasny&lt;/a&gt;, whom I had an opportunity to meet in person at the Bay Area Makerfaire&amp;#160; for re-shipping my kit, after UPS returned package back to Chicago.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;As part of next steps after the challenge, I plan to clean up the code on github and also have a couple of extra features I would like to implement, so remember to check out the blog posts using the tag - &lt;a class="" href="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags#/?tags=upcycledclock"&gt;UpcycledClock&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:bb05d8a0-cfee-4b02-a15c-a73f8efe32dc] --&gt;</description>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">iot</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">mqtt</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">3d printing</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">intel edison</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycleit</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycle it</category>
      <category domain="https://www.element14.com/community/community/design-challenges/upcycleit/blog/tags">upcycledclock</category>
      <pubDate>Sat, 03 Jun 2017 22:01:22 GMT</pubDate>
      <author>messages@element14.com</author>
      <guid>https://www.element14.com/community/community/design-challenges/upcycleit/blog/2017/06/03/upcycled-clock-summary</guid>
      <dc:date>2017-06-03T22:01:22Z</dc:date>
      <clearspace:dateToText>1 month 3 days ago</clearspace:dateToText>
      <clearspace:replyCount>5</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
      <wfw:comment>https://www.element14.com/community/community/design-challenges/upcycleit/blog/comment/upcycled-clock-summary</wfw:comment>
      <wfw:commentRss>https://www.element14.com/community/community/design-challenges/upcycleit/blog/feeds/comments?blogPost=25625</wfw:commentRss>
    </item>
  </channel>
</rss>

