{"id":249,"date":"2019-11-26T08:08:28","date_gmt":"2019-11-26T08:08:28","guid":{"rendered":"https:\/\/starthardware.org\/en\/?p=249"},"modified":"2020-01-06T12:14:07","modified_gmt":"2020-01-06T12:14:07","slug":"interactive-christmas-decoration-part-2","status":"publish","type":"post","link":"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/","title":{"rendered":"Interactive Christmas Decoration \u2013 Part 2"},"content":{"rendered":"\n<p>Now, it is time to make some blink! In this part you will learn how you can utilize the Breadboard and what a digital output is. Finally you will make an LED blink \ud83d\ude42<\/p>\n\n\n\n<p>In order to sketch circuits we will use the breadboard. Equipped with a lot of internally connected holes it makes prototyping easy. You can simply stick components in and they will stay in place. In the following image you can see, in which way the holes of a breadboard are connected.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"624\" src=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-breadboard-function-1024x624.gif\" alt=\"Breadboard\" class=\"wp-image-55\" srcset=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-breadboard-function-1024x624.gif 1024w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-breadboard-function-300x183.gif 300w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-breadboard-function-768x468.gif 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>In the image you can see that the resistor (the orange part) and the LED are placed in the same row. This creates an electrical connection. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The first circuit<\/h2>\n\n\n\n<p>Build up the following circuit on your breadboard. Push the NodeMCU gently into the breadboard so that the first pins are on the very left side. Make sure that you leave one pin row on top and on bottom of the NodeMCU.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"526\" src=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/11\/arduino-christmas-blink-1024x526.jpg\" alt=\"Christmas NodeMCU Blink\" class=\"wp-image-250\" srcset=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/11\/arduino-christmas-blink-1024x526.jpg 1024w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/11\/arduino-christmas-blink-300x154.jpg 300w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/11\/arduino-christmas-blink-768x395.jpg 768w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/11\/arduino-christmas-blink.jpg 1238w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The circuit now goes from the GND of the NodeMCU (bottom left corner) to the black cable on the right. This is connected to the short leg of the LED (cathode). The long leg (anode) is connected to a resistor (220 Ohms). The resistor is reducing the current so that the LED is protected from burning. The resistor then is connected to the Digital Pin 7 of the NodeMCU. Now we have to program it! <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The first program<\/h2>\n\n\n\n<p>Copy and past the following code into the Arduino-Software and upload it to your NodeMCU. Therefore on the menu just click on <em>Sketch&gt;Upload<\/em> or click the Upload-Button (Arrow to the right) in the menu bar.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>int ledPin = D7; \n\nvoid setup() {\n  \/\/ put your setup code here, to run once:\n  pinMode(ledPin, OUTPUT);\n}\n\nvoid loop() {\n  \/\/ put your main code here, to run repeatedly:\n  digitalWrite(ledPin,HIGH);\n  delay(1000);\n  digitalWrite(ledPin,LOW);\n  delay(1000);\n}<\/code><\/pre>\n\n\n\n<p>Is it blinking? Great! As you can see, we have two main methods. The <em>setup()<\/em> method is only executed once while the <em>loop()<\/em> method is constantly repeated. The command <code>digitalWrite(ledPin,HIGH);<\/code> is switching the LED on, <code>digitalWrite(ledPin,LOW);<\/code> switches it off again. The command <code><em>delay(1000)<\/em> <\/code>is stopping the program for 1000 milliseconds. <\/p>\n\n\n\n<p>Now make it blink faster \ud83d\ude42<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Complete Tutorial<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-1\/\">Interactive Christmas Decoration \u2013 Part 1: Preparation<\/a><\/li><li><a href=\"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/\">Interactive Christmas Decoration \u2013 Part 2: Make it blink<\/a><\/li><li><a href=\"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-3-server-and-led\/\">Interactive Christmas Decoration \u2013 Part 3: Server and LED<\/a><\/li><li><a href=\"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-4-server-led-rgb\/\">Interactive Christmas Decoration \u2013 Part 4: Server, LED, RGB<\/a><\/li><li><a href=\"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-5-analog-input-with-ldr\/\">Interactive Christmas Decoration \u2013 Part 5: Analog Input with LDR<\/a><\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>Dieser Beitrag ist auch auf Deutsch verf\u00fcgbar: <a href=\"https:\/\/starthardware.org\/workshop-interaktive-weihnachtsdekoration-teil-2-blink\/\">Workshop: Interaktive Weihnachtsdekoration Teil 2 \u2013 Blink<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now, it is time to make some blink! In this part you will learn how you can utilize the Breadboard and what a digital output is. Finally you will make an LED blink \ud83d\ude42 In order to sketch circuits we will use the breadboard. Equipped with a lot of internally connected holes it makes prototyping&hellip;&nbsp;<a href=\"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Interactive Christmas Decoration \u2013 Part 2<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":252,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[5],"tags":[],"class_list":["post-249","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino-projects"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v18.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Interactive Christmas Decoration \u2013 Part 2 - StartHardware - Tutorials for Arduino<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Interactive Christmas Decoration \u2013 Part 2 - StartHardware - Tutorials for Arduino\" \/>\n<meta property=\"og:description\" content=\"Now, it is time to make some blink! In this part you will learn how you can utilize the Breadboard and what a digital output is. Finally you will make an LED blink \ud83d\ude42 In order to sketch circuits we will use the breadboard. Equipped with a lot of internally connected holes it makes prototyping&hellip;&nbsp;Read More &raquo;Interactive Christmas Decoration \u2013 Part 2\" \/>\n<meta property=\"og:url\" content=\"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/\" \/>\n<meta property=\"og:site_name\" content=\"StartHardware - Tutorials for Arduino\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-26T08:08:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-01-06T12:14:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/11\/InteractiveChristmasDecoration-Part2-Blink2.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"678\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Stefan Hermann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/starthardware.org\/en\/#website\",\"url\":\"https:\/\/starthardware.org\/en\/\",\"name\":\"StartHardware - Tutorials for Arduino\",\"description\":\"Arduino, Electronics, Fun\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/starthardware.org\/en\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/11\/InteractiveChristmasDecoration-Part2-Blink2.jpg\",\"contentUrl\":\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/11\/InteractiveChristmasDecoration-Part2-Blink2.jpg\",\"width\":1200,\"height\":678,\"caption\":\"interactive christmas decoration \u2013 blink\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/#webpage\",\"url\":\"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/\",\"name\":\"Interactive Christmas Decoration \u2013 Part 2 - StartHardware - Tutorials for Arduino\",\"isPartOf\":{\"@id\":\"https:\/\/starthardware.org\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/#primaryimage\"},\"datePublished\":\"2019-11-26T08:08:28+00:00\",\"dateModified\":\"2020-01-06T12:14:07+00:00\",\"author\":{\"@id\":\"https:\/\/starthardware.org\/en\/#\/schema\/person\/811b16fabcbfeef4210ea79cf0990a59\"},\"breadcrumb\":{\"@id\":\"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/starthardware.org\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Interactive Christmas Decoration \u2013 Part 2\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/starthardware.org\/en\/#\/schema\/person\/811b16fabcbfeef4210ea79cf0990a59\",\"name\":\"Stefan Hermann\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/starthardware.org\/en\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5b5a74ee1d07024fd1eff9b1f7137108089169010a93afaee907b9325ee579a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5b5a74ee1d07024fd1eff9b1f7137108089169010a93afaee907b9325ee579a6?s=96&d=mm&r=g\",\"caption\":\"Stefan Hermann\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Interactive Christmas Decoration \u2013 Part 2 - StartHardware - Tutorials for Arduino","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/","og_locale":"en_US","og_type":"article","og_title":"Interactive Christmas Decoration \u2013 Part 2 - StartHardware - Tutorials for Arduino","og_description":"Now, it is time to make some blink! In this part you will learn how you can utilize the Breadboard and what a digital output is. Finally you will make an LED blink \ud83d\ude42 In order to sketch circuits we will use the breadboard. Equipped with a lot of internally connected holes it makes prototyping&hellip;&nbsp;Read More &raquo;Interactive Christmas Decoration \u2013 Part 2","og_url":"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/","og_site_name":"StartHardware - Tutorials for Arduino","article_published_time":"2019-11-26T08:08:28+00:00","article_modified_time":"2020-01-06T12:14:07+00:00","og_image":[{"width":1200,"height":678,"url":"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/11\/InteractiveChristmasDecoration-Part2-Blink2.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"Stefan Hermann","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/starthardware.org\/en\/#website","url":"https:\/\/starthardware.org\/en\/","name":"StartHardware - Tutorials for Arduino","description":"Arduino, Electronics, Fun","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/starthardware.org\/en\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/#primaryimage","inLanguage":"en-US","url":"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/11\/InteractiveChristmasDecoration-Part2-Blink2.jpg","contentUrl":"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/11\/InteractiveChristmasDecoration-Part2-Blink2.jpg","width":1200,"height":678,"caption":"interactive christmas decoration \u2013 blink"},{"@type":"WebPage","@id":"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/#webpage","url":"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/","name":"Interactive Christmas Decoration \u2013 Part 2 - StartHardware - Tutorials for Arduino","isPartOf":{"@id":"https:\/\/starthardware.org\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/#primaryimage"},"datePublished":"2019-11-26T08:08:28+00:00","dateModified":"2020-01-06T12:14:07+00:00","author":{"@id":"https:\/\/starthardware.org\/en\/#\/schema\/person\/811b16fabcbfeef4210ea79cf0990a59"},"breadcrumb":{"@id":"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/starthardware.org\/en\/interactive-christmas-decoration-part-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/starthardware.org\/en\/"},{"@type":"ListItem","position":2,"name":"Interactive Christmas Decoration \u2013 Part 2"}]},{"@type":"Person","@id":"https:\/\/starthardware.org\/en\/#\/schema\/person\/811b16fabcbfeef4210ea79cf0990a59","name":"Stefan Hermann","image":{"@type":"ImageObject","@id":"https:\/\/starthardware.org\/en\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/5b5a74ee1d07024fd1eff9b1f7137108089169010a93afaee907b9325ee579a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5b5a74ee1d07024fd1eff9b1f7137108089169010a93afaee907b9325ee579a6?s=96&d=mm&r=g","caption":"Stefan Hermann"}}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/posts\/249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/comments?post=249"}],"version-history":[{"count":5,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/posts\/249\/revisions"}],"predecessor-version":[{"id":288,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/posts\/249\/revisions\/288"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/media\/252"}],"wp:attachment":[{"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/media?parent=249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/categories?post=249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/tags?post=249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}