{"id":168,"date":"2019-10-23T09:45:40","date_gmt":"2019-10-23T09:45:40","guid":{"rendered":"https:\/\/starthardware.org\/en\/?p=168"},"modified":"2020-01-06T13:01:12","modified_gmt":"2020-01-06T13:01:12","slug":"arduino-jack-olantern-with-animated-eyes","status":"publish","type":"post","link":"https:\/\/starthardware.org\/en\/arduino-jack-olantern-with-animated-eyes\/","title":{"rendered":"Arduino Jack O&#8217;Lantern with animated eyes"},"content":{"rendered":"\n<p>I&#8217;m a big Halloween fan and I like to celebrate the ghost party. In this project you will learn how to build an Arduino Jack O&#8217;Lantern with animated eyes. <\/p>\n\n\n\n<p>You will need two matrix displays with Max7219 driver, an Arduino board and a pumpkin. As a matrix display I recommend <a href=\"https:\/\/www.amazon.com\/Wangdd22-MAX7219-Display-Single-Chip-Control\/dp\/B076Q5YFY8\/ref=sr_1_3?crid=303T5ALWMU745&amp;keywords=led+matrix+arduino&amp;qid=1571822930&amp;sprefix=led+matrix%2Caps%2C226&amp;sr=8-3\">thoes<\/a>*:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-matrix-max7219.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"878\" height=\"657\" src=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-matrix-max7219.jpg\" alt=\"Arduino with MAX7219 IC\" class=\"wp-image-169\" srcset=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-matrix-max7219.jpg 878w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-matrix-max7219-300x224.jpg 300w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-matrix-max7219-768x575.jpg 768w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-matrix-max7219-500x375.jpg 500w\" sizes=\"auto, (max-width: 878px) 100vw, 878px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Arduino Matrix Circuit with Max7219<\/h2>\n\n\n\n<p>The circuit is relatively straightforward. Simply attach the pins as shown in the picture.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"315\" src=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-led-matrix-max7219-reihe-1024x315.jpg\" alt=\"\" class=\"wp-image-171\" srcset=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-led-matrix-max7219-reihe-1024x315.jpg 1024w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-led-matrix-max7219-reihe-300x92.jpg 300w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-led-matrix-max7219-reihe-768x236.jpg 768w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-led-matrix-max7219-reihe.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Program text for the Arduino Jack O&#8217;Lantern<\/h2>\n\n\n\n<p>In order to run the code you have to install the LedControl library. In the Arduino software click on <em>Sketch&gt;Libraries&gt;Manage libraries<\/em> and search for LedControl. Install the latest version.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/We always have to include the library\n#include \"LedControl.h\"\n\n\/*\n Now we need a LedControl to work with.\n ***** These pin numbers will probably not work with your hardware *****\n pin 12 is connected to the DataIn \n pin 11 is connected to the CLK \n pin 10 is connected to LOAD \n We have only a single MAX72XX.\n *\/\n\nLedControl lc = LedControl(12, 11, 10, 1);\nint eyePosition = 4;\n\nvoid setup() {\n  lc.shutdown(0, false);\n  lc.shutdown(1, false);\n  lc.setIntensity(0, 8);\n  lc.setIntensity(1, 8);\n  lc.clearDisplay(0);\n  lc.clearDisplay(1);\n}\n\nvoid loop() {\n  if (random(20)==1){\n    evilEyes(random(20, 45), random(5));\n  }    \n  delay(20);\n}\n\nvoid evilEyes(int wait, int newEyePosition) {\n\n  while (newEyePosition != eyePosition) {\n    if (newEyePosition &lt; eyePosition) eyePosition--;\n    if (newEyePosition > eyePosition) eyePosition++;\n    lc.clearDisplay(0);\n    for (int i = 0; i &lt; 5; i++) { \/\/ For each pixel in strip...\n      if (i == eyePosition) {\n        lc.setLed(0, 2, i+1, 1);\n        lc.setLed(0, 2, i+2, 1);\n\n        lc.setLed(0, 3, i, 1);\n        lc.setLed(0, 3, i+1, 1);\n        lc.setLed(0, 3, i+2, 1);\n        lc.setLed(0, 3, i+3, 1);\n\n        lc.setLed(0, 4, i, 1);\n        lc.setLed(0, 4, i+1, 1);\n        lc.setLed(0, 4, i+2, 1);\n        lc.setLed(0, 4, i+3, 1);\n\n        lc.setLed(0, 5, i+1, 1);\n        lc.setLed(0, 5, i+2, 1);   \n        lc.setLed(0, 5, i+2, 1);        \n      } \n    }\n    delay(wait);\n  }\n}<\/code><\/pre>\n\n\n\n<p>This program presents two animated eyes displayed on the matrix. <\/p>\n\n\n\n<p>Now hollow out a pumpkin and pack in the electronics. I always use a garbage bag to keep the hardware from getting wet. To fix the hardware I use needles.<\/p>\n\n\n\n<p>Find more information on the Max7219 Matrix on this tutorial page: <a href=\"https:\/\/starthardware.org\/en\/arduino-matrix-display-8-x-8-pixels-and-lots-of-fun\/\">https:\/\/starthardware.org\/en\/arduino-matrix-display-8-x-8-pixels-and-lots-of-fun\/<\/a><\/p>\n\n\n\n<p>I hope you enjoy the project. Send me your project photos and I put the in the gallery on this page \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m a big Halloween fan and I like to celebrate the ghost party. In this project you will learn how to build an Arduino Jack O&#8217;Lantern with animated eyes. You will need two matrix displays with Max7219 driver, an Arduino board and a pumpkin. As a matrix display I recommend thoes*: Arduino Matrix Circuit with&hellip;&nbsp;<a href=\"https:\/\/starthardware.org\/en\/arduino-jack-olantern-with-animated-eyes\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Arduino Jack O&#8217;Lantern with animated eyes<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":172,"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-168","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>Project: Arduino Jack O&#039;Lantern with animated eyes<\/title>\n<meta name=\"description\" content=\"Build your own Arduino Jack O&#039;Lantern with animated eyes. We will use LED matrix displays and some nice animations: code, circuit, explainations. Let&#039;s go!\" \/>\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\/arduino-jack-olantern-with-animated-eyes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Project: Arduino Jack O&#039;Lantern with animated eyes\" \/>\n<meta property=\"og:description\" content=\"Build your own Arduino Jack O&#039;Lantern with animated eyes. We will use LED matrix displays and some nice animations: code, circuit, explainations. Let&#039;s go!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/starthardware.org\/en\/arduino-jack-olantern-with-animated-eyes\/\" \/>\n<meta property=\"og:site_name\" content=\"StartHardware - Tutorials for Arduino\" \/>\n<meta property=\"article:published_time\" content=\"2019-10-23T09:45:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-01-06T13:01:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-ku\u0308rbis-augen-bewegen-sich.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/gif\" \/>\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\/arduino-jack-olantern-with-animated-eyes\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-ku\u0308rbis-augen-bewegen-sich.gif\",\"contentUrl\":\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-ku\u0308rbis-augen-bewegen-sich.gif\",\"width\":1200,\"height\":675,\"caption\":\"Arduino Jack O'Lantern with animated eyes\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/starthardware.org\/en\/arduino-jack-olantern-with-animated-eyes\/#webpage\",\"url\":\"https:\/\/starthardware.org\/en\/arduino-jack-olantern-with-animated-eyes\/\",\"name\":\"Project: Arduino Jack O'Lantern with animated eyes\",\"isPartOf\":{\"@id\":\"https:\/\/starthardware.org\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/starthardware.org\/en\/arduino-jack-olantern-with-animated-eyes\/#primaryimage\"},\"datePublished\":\"2019-10-23T09:45:40+00:00\",\"dateModified\":\"2020-01-06T13:01:12+00:00\",\"author\":{\"@id\":\"https:\/\/starthardware.org\/en\/#\/schema\/person\/811b16fabcbfeef4210ea79cf0990a59\"},\"description\":\"Build your own Arduino Jack O'Lantern with animated eyes. We will use LED matrix displays and some nice animations: code, circuit, explainations. Let's go!\",\"breadcrumb\":{\"@id\":\"https:\/\/starthardware.org\/en\/arduino-jack-olantern-with-animated-eyes\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/starthardware.org\/en\/arduino-jack-olantern-with-animated-eyes\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/starthardware.org\/en\/arduino-jack-olantern-with-animated-eyes\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/starthardware.org\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Arduino Jack O&#8217;Lantern with animated eyes\"}]},{\"@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":"Project: Arduino Jack O'Lantern with animated eyes","description":"Build your own Arduino Jack O'Lantern with animated eyes. We will use LED matrix displays and some nice animations: code, circuit, explainations. Let's go!","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\/arduino-jack-olantern-with-animated-eyes\/","og_locale":"en_US","og_type":"article","og_title":"Project: Arduino Jack O'Lantern with animated eyes","og_description":"Build your own Arduino Jack O'Lantern with animated eyes. We will use LED matrix displays and some nice animations: code, circuit, explainations. Let's go!","og_url":"https:\/\/starthardware.org\/en\/arduino-jack-olantern-with-animated-eyes\/","og_site_name":"StartHardware - Tutorials for Arduino","article_published_time":"2019-10-23T09:45:40+00:00","article_modified_time":"2020-01-06T13:01:12+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-ku\u0308rbis-augen-bewegen-sich.gif","type":"image\/gif"}],"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\/arduino-jack-olantern-with-animated-eyes\/#primaryimage","inLanguage":"en-US","url":"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-ku\u0308rbis-augen-bewegen-sich.gif","contentUrl":"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-ku\u0308rbis-augen-bewegen-sich.gif","width":1200,"height":675,"caption":"Arduino Jack O'Lantern with animated eyes"},{"@type":"WebPage","@id":"https:\/\/starthardware.org\/en\/arduino-jack-olantern-with-animated-eyes\/#webpage","url":"https:\/\/starthardware.org\/en\/arduino-jack-olantern-with-animated-eyes\/","name":"Project: Arduino Jack O'Lantern with animated eyes","isPartOf":{"@id":"https:\/\/starthardware.org\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/starthardware.org\/en\/arduino-jack-olantern-with-animated-eyes\/#primaryimage"},"datePublished":"2019-10-23T09:45:40+00:00","dateModified":"2020-01-06T13:01:12+00:00","author":{"@id":"https:\/\/starthardware.org\/en\/#\/schema\/person\/811b16fabcbfeef4210ea79cf0990a59"},"description":"Build your own Arduino Jack O'Lantern with animated eyes. We will use LED matrix displays and some nice animations: code, circuit, explainations. Let's go!","breadcrumb":{"@id":"https:\/\/starthardware.org\/en\/arduino-jack-olantern-with-animated-eyes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/starthardware.org\/en\/arduino-jack-olantern-with-animated-eyes\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/starthardware.org\/en\/arduino-jack-olantern-with-animated-eyes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/starthardware.org\/en\/"},{"@type":"ListItem","position":2,"name":"Arduino Jack O&#8217;Lantern with animated eyes"}]},{"@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\/168","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=168"}],"version-history":[{"count":3,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/posts\/168\/revisions"}],"predecessor-version":[{"id":329,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/posts\/168\/revisions\/329"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/media\/172"}],"wp:attachment":[{"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/media?parent=168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/categories?post=168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/tags?post=168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}