CINXE.COM
Make a Mind-Controlled Arduino Robot[Book]
<!DOCTYPE html> <!--[if lt IE 10]><html class="no-js ie8 oldie" lang="en" prefix="og: http://ogp.me/ns/# og:book: http://ogp.me/ns/book# og:video: http://ogp.me/ns/video#" itemscope itemtype="http://schema.org/Book http://schema.org/CollectionPage" data-offline-url="/" data-url="/library/view/make-a-mind-controlled/9781449312800/" data-reading-url="/library/view/make-a-mind-controlled/9781449312800/ch01.html" data-archive="9781449312800" data-publishers="O'Reilly Media, Inc." data-book-overview="true" data-federated-auth-enabled="true" data-env="production" data-debug="0" ><![endif]--> <!--[if gt IE 9]><!--><html class="no-js" lang="en" prefix="og: http://ogp.me/ns/# og:book: http://ogp.me/ns/book# og:video: http://ogp.me/ns/video#" itemscope itemtype="http://schema.org/Book http://schema.org/CollectionPage" data-offline-url="/" data-url="/library/view/make-a-mind-controlled/9781449312800/" data-reading-url="/library/view/make-a-mind-controlled/9781449312800/ch01.html" data-archive="9781449312800" data-publishers="O'Reilly Media, Inc." data-book-overview="true" data-federated-auth-enabled="true" data-env="production" data-debug="0" ><!--<![endif]--> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title>Make a Mind-Controlled Arduino Robot[Book]</title> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="stylesheet" href="/library/view/static/CACHE/css/output.119cc64003b7.css" type="text/css"> <link href='//fonts.googleapis.com/css?family=Source+Sans+Pro' rel='stylesheet' type='text/css' /> <link rel="stylesheet" type="text/css" href="https://cdn.oreillystatic.com/assets/css/2018_font_face.css" /> <meta property="og:title" content="Make a Mind-Controlled Arduino Robot" /> <meta itemprop="name" content="Make a Mind-Controlled Arduino Robot" /> <meta property="og:url" itemprop="url" content="https://www.oreilly.com/library/view/make-a-mind-controlled/9781449312800/" /> <meta property="og:site_name" content="O’Reilly Online Learning" /> <meta property="og:description" itemprop="description" name="description" content="Think about it - and it moves. Think harder, the robot moves faster. But don't worry; as a robot it knows to avoid the black border so it doesn't fall … - Selection from Make a Mind-Controlled Arduino Robot [Book]"> <meta itemprop="inLanguage" content="en" /> <meta itemprop="publisher" content="O'Reilly Media, Inc." /> <meta property="og:type" content="article" /> <meta property="og:book:isbn" itemprop="isbn" content="9781449311544" /> <meta property="og:book:author" itemprop="author" content="Tero Karvinen" /> <meta property="og:book:author" itemprop="author" content="Kimmo Karvinen" /> <meta property="og:image" itemprop="thumbnailUrl" content="https://www.oreilly.com/library/cover/9781449312800/1200w630h/" /> <meta property="og:image:secure_url" itemprop="thumbnailUrl" content="https://www.oreilly.com/library/cover/9781449312800/1200w630h/"> <meta property="og:image:width" content="1200"> <meta property="og:image:height" content="630"> <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:site" content="@OReillyMedia"> <!-- Start Visual Website Optimizer Asynchronous Code --> <script type='text/javascript'> var _vwo_code=(function(){ var account_id=291788, settings_tolerance=2000, library_tolerance=2500, use_existing_jquery=false, /* DO NOT EDIT BELOW THIS LINE */ f=false,d=document;return{use_existing_jquery:function(){return use_existing_jquery;},library_tolerance:function(){return library_tolerance;},finish:function(){if(!f){f=true;var a=d.getElementById('_vis_opt_path_hides');if(a)a.parentNode.removeChild(a);}},finished:function(){return f;},load:function(a){var b=d.createElement('script');b.src=a;b.type='text/javascript';b.innerText;b.onerror=function(){_vwo_code.finish();};d.getElementsByTagName('head')[0].appendChild(b);},init:function(){settings_timer=setTimeout('_vwo_code.finish()',settings_tolerance);var a=d.createElement('style'),b='body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}',h=d.getElementsByTagName('head')[0];a.setAttribute('id','_vis_opt_path_hides');a.setAttribute('type','text/css');if(a.styleSheet)a.styleSheet.cssText=b;else a.appendChild(d.createTextNode(b));h.appendChild(a);this.load('//dev.visualwebsiteoptimizer.com/j.php?a='+account_id+'&u='+encodeURIComponent(d.URL)+'&r='+Math.random());return settings_timer;}};}());_vwo_settings_timer=_vwo_code.init(); </script> <!-- End Visual Website Optimizer Asynchronous Code --> <link class="t-canonical-link" rel="canonical" href="https://www.oreilly.com/library/view/make-a-mind-controlled/9781449312800/" /> <link rel="shortcut icon" href="//www.oreilly.com/favicon.ico" type="image/vnd.microsoft.icon" /> <link rel="apple-touch-icon" href="/library/view/static/images/apple-touch-icon.png" /> </head> <body class="js-preview-content "> <div class="skipToMain" id="skipToMain"><a href="#maincontent"><span class="skipToMain-text">Skip to main content</span></a></div> <header role="banner" class="global"> <div class="global-nav"> <div class="content"> <nav role="navigation" aria-label="site sections"> <a href="https://www.oreilly.com" class="logo" title="home page" aria-current="page"><img src="https://cdn.oreillystatic.com/images/sitewide-headers/oreilly_logo_mark_red.svg" onerror="this.src='https://cdn.oreillystatic.com/images/sitewide-headers/oreilly_logo_mark_red_@2x.png'; this.onerror=null;" alt="O'Reilly home"></a> <button id="mobileNavButton" class="mobileNavButton mobileNavButton--collapse mobileNavButton--3dx" type="button" aria-expanded="false" aria-controls="menuList"> <span class="mobileNavButton-box"> <span class="mobileNavButton-inner"></span> </span> </button> <ul id="menuList" class="menuList mobileHidden "> <li class="menuList-itemsP1"> <ul> <li class="menuList-item menuList-signIn"><a class="t-sign-in" href="/member/login/?next=/library/view/make-a-mind-controlled/9781449312800/">Sign In</a></li> <li class="menuList-item menuList-tryNow"><a class="menuList-cta" href="https://learning.oreilly.com/start-trial/?next=/library/view/make-a-mind-controlled/9781449312800/">Try Now</a></li> </ul> </li> <li class="menuList-itemsP2"> <ul> <li class="menuList-item menuList-itemWithSub"><a href="https://www.oreilly.com/online-learning/teams.html">Teams</a> <ul class="menuList-subList menuList-itemWithSub"> <li class="menuList-subItem menuList-extra"><a href="https://www.oreilly.com/online-learning/business.html">For business</a></li> <li class="menuList-subItem"><a href="https://www.oreilly.com/online-learning/government.html">For government</a></li> <li class="menuList-subItem"><a href="https://www.oreilly.com/online-learning/academic.html">For higher ed</a></li> </ul> </li> <li class="menuList-item"><a href="https://www.oreilly.com/online-learning/individuals.html">Individuals</a></li> <li class="menuList-item menuList-itemWithSub"><a href="https://www.oreilly.com/online-learning/features.html">Features</a> <ul class="menuList-subList"> <li class="menuList-subItem menuList-extra"><a href="https://www.oreilly.com/online-learning/features.html">All features</a></li> <li class="menuList-subItem"><a href="https://www.oreilly.com/online-learning/courses.html">Courses</a></li> <li class="menuList-subItem"><a href="https://www.oreilly.com/online-learning/feature-certification.html">Certifications</a></li> <li class="menuList-subItem"><a href="https://www.oreilly.com/online-learning/intro-interactive-learning.html">Interactive learning</a></li> <li class="menuList-subItem"><a href="https://www.oreilly.com/online-learning/live-events.html">Live events</a></li> <li class="menuList-subItem"><a href="https://www.oreilly.com/online-learning/feature-answers.html">Answers</a></li> <li class="menuList-subItem"><a href="https://www.oreilly.com/online-learning/insights-dashboard.html">Insights reporting</a></li> </ul> </li> <li class="menuList-item"><a href="https://www.oreilly.com/radar/">Blog</a></li> <li class="menuList-item" id="nav-forMarketers"><a href="https://www.oreilly.com/content-marketing-solutions.html">Content sponsorship</a></li> </ul> </li> </ul> </nav> </div> </div> <div class="global-search"> <div id="globalSearchContent" class="content"> <form id="js-search-form" class="t-navigation-form" action="https://learning.oreilly.com/search/"> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "WebSite", "url": "https://learning.oreilly.com", "potentialAction": { "@type": "SearchAction", "target": "https://learning.oreilly.com/search/?q={search_term_string}", "query-input": "required name=search_term_string" } } </script> <input data-search-text-focus= "See everything available through the O’Reilly learning platform and start a free trial. Explore now." data-search-text-idle = "See everything available through the O’Reilly learning platform and start a free trial. Explore now." id="search" type="search" name="query" placeholder="See everything available through the O’Reilly learning platform and start a free trial. Explore now." autocomplete="off" required /> <input type="submit" value="Search" class="search-submit" /> </form> </div> </div> </header> <section id="trial-overlay"> <div class="trial-overlay-content"> <p>Get full access to <em>Make a Mind-Controlled Arduino Robot</em> and 60K+ other titles, with a free 10-day trial of O'Reilly.</p> <p>There are also live events, courses curated by job role, <span class="nowrap">and more.</span></p> <div class="controls"> <a href="https://learning.oreilly.com/start-trial/?next=/library/view/make-a-mind-controlled/9781449312800/" class="button-primary" data-ga-label="Bottom CTA">Start your free trial</a> </div> <a class="modal-dismiss" aria-label="modal dismiss"></a> </div> </section> <main role="main" id="maincontent"> <div role="document" class="document"> <section id="sbo-reader" class="sbo-reader-title"> <div class="title-info"> <div class="content"> <figure class="t-cover"> <img class="t-cover-img" src="https://learning.oreilly.com/library/cover/9781449312800/250w/" alt="Make a Mind-Controlled Arduino Robot"/> </figure> <div class="metadata"> <h1 class="t-title">Make a Mind-Controlled Arduino Robot</h1> <div class="t-authors">by <a href="/search?q=author:"Tero Karvinen"" class="author-name">Tero Karvinen</a>, <a href="/search?q=author:"Kimmo Karvinen"" class="author-name">Kimmo Karvinen</a> </div> <div class="t-release-date">Released December 2011</div> <div class="t-publisher">Publisher(s): O'Reilly Media, Inc.</div> <div class="t-isbn">ISBN: 9781449311544</div> <div id="titlePromo"> <p class="t-promo"> Read it now on the O’Reilly learning platform with a 10-day <span class="nowrap">free trial.</span> </p> <p class="t-promo">O’Reilly members get unlimited access to books, live events, courses curated by job role, and more from O’Reilly and nearly <span class="nowrap">200 top publishers.</span></p> </div> <div class="controls"> <div class="buy-button-group"> <a href="https://www.amazon.com/_/dp/1449311547?smid=ATVPDKIKX0DER&_encoding=UTF8&tag=oreilly20-20" id="buyAmazon" class="button-primary">Buy on Amazon</a> <a href="https://www.ebooks.com/search/?term=9781449311544&affid=OMI5374258" id="buyEbookscom" class="button-secondary">Buy on ebooks.com</a> </div> <a href="https://learning.oreilly.com/start-trial/?next=/library/view/make-a-mind-controlled/9781449312800/" id="startTrial" class="button-secondary">Start <span class="mobile-hide">your</span> free trial</a> </div> <div id="next-edition"> </div> </div> </div> </div> <div class="title-description t-description sbo-reader-content"> <div class="content"> <h2 class="t-description-heading"> Book description</h2> <span><span><p>Think about it - and it moves. Think harder, the robot moves faster. But don't worry; as a robot it knows to avoid the black border so it doesn't fall off the table.</p><p>"Make a Mind Controlled Arduino Robot" shows you how to build your own. You learn to measure attention level with a NeuroSky headband and send this information into Arduino. You will also build a line-avoiding system into the bot. And, of course, you will build the chassis of your robot from scratch.</p></span></span> <div id="showMoreDescription" class="showMore hidden"><button class="more"><span class="screen-reader-text">Show and hide more</span></button></div> <div id="toc-start"></div> </div> </div> <div id="title-tabs" class="title-tabs"><button id="title-tab-toc" class="title-tab title-tab-active" data-target="toc">Table of contents</button><button id="title-tab-pi" class="title-tab" data-target="product-information">Product information</button></div> <div class="title-toc" id="toc"> <div class="content"> <h2>Table of contents</h2> <ol class="detail-toc"> <li class="toc-level-1 t-toc-level-1"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/index.html" class="t-chapter js-chapter">Make a Mind-Controlled Arduino Robot</a> <ol> <li class="toc-level-2 t-toc-level-2"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/upgrade_offer_front.html" class="t-chapter js-chapter">SPECIAL OFFER: Upgrade this ebook with O’Reilly</a> </li> <li class="toc-level-2 t-toc-level-2"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/examples_page.html" class="t-chapter js-chapter">A Note Regarding Supplemental Files</a> </li> <li class="toc-level-2 t-toc-level-2"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/pr03.html" class="t-chapter js-chapter">Preface</a> <ol> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/pr03.html#I_sect1_d1e180" class="t-chapter js-chapter">From Helsinki to San Francisco</a> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/pr03s02.html" class="t-chapter js-chapter">Reactions</a> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/pr03s03.html" class="t-chapter js-chapter">EEG in Your Living Room</a> <ol> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/pr03s03.html#id2964928" class="t-chapter js-chapter">NeuroSky MindWave</a> </li> </ol> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/pr03s04.html" class="t-chapter js-chapter">What Do You Need to Know?</a> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/pr03s05.html" class="t-chapter js-chapter">Acknowledgments</a> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/pr03s06.html" class="t-chapter js-chapter">Conventions Used in This Book</a> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/pr03s07.html" class="t-chapter js-chapter">Using Code Examples</a> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/pr03s08.html" class="t-chapter js-chapter">Safari® Books Online</a> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/pr03s09.html" class="t-chapter js-chapter">How to Contact Us</a> </li> </ol> </li> <li class="toc-level-2 t-toc-level-2"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch01.html" class="t-chapter js-chapter">1. Building the Chassis</a> <ol> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch01.html#_tools_and_parts" class="t-chapter js-chapter">Tools and Parts</a> <ol> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch01.html#_parts" class="t-chapter js-chapter">Parts</a> </li> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch01.html#_tools" class="t-chapter js-chapter">Tools</a> </li> </ol> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch01s02.html" class="t-chapter js-chapter">Servo Motors</a> <ol> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch01s02.html#_attaching_servos" class="t-chapter js-chapter">Attaching Servos</a> </li> </ol> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch01s03.html" class="t-chapter js-chapter">Chassis</a> <ol> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch01s03.html#_making_holes" class="t-chapter js-chapter">Making Holes</a> </li> </ol> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch01s04.html" class="t-chapter js-chapter">Painting the Chassis</a> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch01s05.html" class="t-chapter js-chapter">Attaching Servos to the Chassis</a> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch01s06.html" class="t-chapter js-chapter">Attaching the Line-Detecting Sensor</a> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch01s07.html" class="t-chapter js-chapter">Wheels</a> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch01s08.html" class="t-chapter js-chapter">Attaching the RGB LED to Chassis</a> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch01s09.html" class="t-chapter js-chapter">Attaching the Power Switch to the Chassis</a> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch01s10.html" class="t-chapter js-chapter">Attaching Arduino</a> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch01s11.html" class="t-chapter js-chapter">Battery Holder</a> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch01s12.html" class="t-chapter js-chapter">Attaching Solderless Breadboard</a> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch01s13.html" class="t-chapter js-chapter">ScrewShield Holds Wires in Place</a> </li> </ol> </li> <li class="toc-level-2 t-toc-level-2"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02.html" class="t-chapter js-chapter">2. Coding</a> <ol> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02.html#_moving" class="t-chapter js-chapter">Moving</a> <ol> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02.html#_connect_servos" class="t-chapter js-chapter">Connect Servos</a> </li> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02.html#_hello_servo" class="t-chapter js-chapter">Hello Servo</a> </li> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02.html#_calibrate_stopping_point" class="t-chapter js-chapter">Calibrate Stopping Point</a> </li> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02.html#_full_speed_forward" class="t-chapter js-chapter">Full Speed Forward</a> </li> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02.html#_other_ways_to_control_servos" class="t-chapter js-chapter">Other Ways to Control Servos</a> </li> </ol> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s02.html" class="t-chapter js-chapter">Line Avoidance</a> <ol> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s02.html#_connect_the_reflection_sensor" class="t-chapter js-chapter">Connect the Reflection Sensor</a> </li> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s02.html#_hello_reflection" class="t-chapter js-chapter">Hello Reflection</a> </li> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s02.html#_don_8217_t_cross_the_black_line" class="t-chapter js-chapter">Don’t Cross the Black Line</a> </li> </ol> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s03.html" class="t-chapter js-chapter">Battery, No Strings Attached</a> <ol> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s03.html#_choosing_rechargeable_batteries" class="t-chapter js-chapter">Choosing Rechargeable Batteries</a> </li> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s03.html#_connecting_the_battery_and_power_key" class="t-chapter js-chapter">Connecting the Battery and Power Key</a> </li> </ol> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s04.html" class="t-chapter js-chapter">Bells and Whistles</a> <ol> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s04.html#_red_green_and_blue_led" class="t-chapter js-chapter">Red, Green, and Blue LED</a> <ol> <li class="toc-level-5 t-toc-level-5"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s04.html#_soldering_rgb_led" class="t-chapter js-chapter">Soldering RGB LED</a> </li> <li class="toc-level-5 t-toc-level-5"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s04.html#_hello_rgb" class="t-chapter js-chapter">Hello RGB</a> </li> </ol> </li> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s04.html#_beeping_piezo" class="t-chapter js-chapter">Beeping Piezo</a> </li> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s04.html#_setting_threshold_with_a_potentiometer" class="t-chapter js-chapter">Setting Threshold with a Potentiometer</a> </li> </ol> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s05.html" class="t-chapter js-chapter">Everything But Your Mind</a> <ol> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s05.html#_code_structure" class="t-chapter js-chapter">Code Structure</a> </li> </ol> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s06.html" class="t-chapter js-chapter">Measuring Your Brains with MindWave</a> <ol> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s06.html#_hack_mindwave_dongle" class="t-chapter js-chapter">Hack MindWave Dongle</a> </li> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s06.html#_level_conversion_with_resistors" class="t-chapter js-chapter">Level Conversion with Resistors</a> <ol> <li class="toc-level-5 t-toc-level-5"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s06.html#_voltage_divider" class="t-chapter js-chapter">Voltage Divider</a> </li> </ol> </li> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s06.html#_hello_attention" class="t-chapter js-chapter">Hello Attention!</a> </li> <li class="toc-level-4 t-toc-level-4"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s06.html#_neurosky_protocol" class="t-chapter js-chapter">NeuroSky Protocol</a> </li> </ol> </li> <li class="toc-level-3 t-toc-level-3"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/ch02s07.html" class="t-chapter js-chapter">Complete Mind-Controlled Robot</a> </li> </ol> </li> <li class="toc-level-2 t-toc-level-2"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/apa.html" class="t-chapter js-chapter">A. Building the ScrewShield</a> </li> <li class="toc-level-2 t-toc-level-2"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/author_bios.html" class="t-chapter js-chapter">About the Authors</a> </li> <li class="toc-level-2 t-toc-level-2"> <a href="https://learning.oreilly.com/library/view/make-a-mind-controlled/9781449312800/upgrade_offer_back.html" class="t-chapter js-chapter">SPECIAL OFFER: Upgrade this ebook with O’Reilly</a> </li> </ol> </li> </ol> <div id="showMoreTOC" class="showMore hidden"><button class="more"><span class="screen-reader-text">Show and hide more</span></button></div> </div> </div> <div id="product-information" class="title-product-information"> <div class="content"> <h2>Product information</h2> <ul class="detail-product-information"> <li><span class="name">Title:</span> <span class="value">Make a Mind-Controlled Arduino Robot</span></li> <li><span class="name">Author(s):</span> <span class="value authors">Tero Karvinen, Kimmo Karvinen</span></li> <li><span class="name">Release date:</span> <span class="value">December 2011</span></li> <li><span class="name">Publisher(s):</span> <span class="value t-publishers">O'Reilly Media, Inc.</span></li> <li><span class="name">ISBN:</span> <span class="value t-isbn">9781449311544</span></li> </ul> </div> </div> <div class="title-recommendations" id="recommendations"> <div class="content"> <h2 class="t-recommendations-heading">You might also like</h2> <div class="recommendations"> <a id="recommendation1" class="recommendations-item" href="https://learning.oreilly.com/library/view/-/9780071782777/" data-id="9780071782777"> <figure class="recommendations-cover" style="background-image:url(https://learning.oreilly.com/library/cover/9780071782777//300h/)"></figure> <p class="recommendations-format recommendations-format-book">book</p> <h3 class="recommendations-title">Arduino Robot Bonanza</h3> <p class="recommendations-authors"> by Gordon McComb </p> <p class="recommendations-description">Create high-tech walking, talking, and thinking robots "McComb hasn’t missed a beat. It’s an absolute winner!" …</p> </a> <a id="recommendation2" class="recommendations-item" href="https://learning.oreilly.com/library/view/-/9781118948460/" data-id="9781118948460"> <figure class="recommendations-cover" style="background-image:url(https://learning.oreilly.com/library/cover/9781118948460//300h/)"></figure> <p class="recommendations-format recommendations-format-book">book</p> <h3 class="recommendations-title">Adventures in Arduino</h3> <p class="recommendations-authors"> by Becky Stewart </p> <p class="recommendations-description">Arduino programming for the absolute beginner, with project-based learning Adventures in Arduino is the beginner's guide …</p> </a> <a id="recommendation3" class="recommendations-item" href="https://learning.oreilly.com/library/view/-/9781449304911/" data-id="9781449304911"> <figure class="recommendations-cover" style="background-image:url(https://learning.oreilly.com/library/cover/9781449304911//300h/)"></figure> <p class="recommendations-format recommendations-format-book">book</p> <h3 class="recommendations-title">Make: Arduino Bots and Gadgets</h3> <p class="recommendations-authors"> by Tero Karvinen, Kimmo Karvinen </p> <p class="recommendations-description">Want to build your own robots, turn your ideas into prototypes, control devices with a computer, …</p> </a> <a id="recommendation4" class="recommendations-item" href="https://learning.oreilly.com/library/view/-/9781430236238/" data-id="9781430236238"> <figure class="recommendations-cover" style="background-image:url(https://learning.oreilly.com/library/cover/9781430236238//300h/)"></figure> <p class="recommendations-format recommendations-format-book">book</p> <h3 class="recommendations-title">Arduino Projects to Save the World</h3> <p class="recommendations-authors"> by Emery Premeaux </p> <p class="recommendations-description">Arduino Projects to Save the World shows that it takes little more than a few tools, …</p> </a> </div> </div> </div> </section> </div> </main> <footer id="footer" class="footer"> <div class="content"> <div class="footer-main" aria-label="company info"> <div class="footer-mainLeft"> <div class="footer-mainLeftOne"> <div class="footer-approach"> <h2 class="footer-header"><a href="https://www.oreilly.com/about/">About O’Reilly</a></h2> <ul class="footer-links"> <li><a href="https://www.oreilly.com/work-with-us.html">Teach/write/train</a></li> <li><a href="https://www.oreilly.com/careers/">Careers</a></li> <li><a href="https://www.oreilly.com/press/">Press releases</a></li> <li><a href="https://www.oreilly.com/press/media-coverage.html">Media coverage</a></li> <li><a href="https://www.oreilly.com/partner/signup.csp">Community partners</a></li> <li><a href="https://www.oreilly.com/affiliates/">Affiliate program</a></li> <li><a href="https://www.oreilly.com/online-learning/rfp.html">Submit an RFP</a></li> <li><a href="https://www.oreilly.com/diversity/">Diversity</a></li> <li><a href="https://www.oreilly.com/content-marketing-solutions.html" id="footerSponsorshipLink">O’Reilly for marketers</a></li> </ul> </div> </div> <div class="footer-mainLeftTwo"> <div class="footer-contact"> <h2 class="footer-header"><a href="https://www.oreilly.com/online-learning/support/">Support</a></h2> <ul class="footer-links"> <li><a href="https://www.oreilly.com/about/contact.html">Contact us</a></li> <li><a href="https://www.oreilly.com/emails/newsletters/">Newsletters</a></li> <li><a href="https://www.oreilly.com/privacy.html">Privacy policy</a></li> </ul> <a href="https://twitter.com/oreillymedia" target="_blank"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 400 400" style="enable-background:new 0 0 400 400;" xml:space="preserve"><style type="text/css">.st0{fill:#ee0000;}.st1{fill:#FFFFFF;}</style><g id="Red"><circle class="st0" cx="200" cy="200" r="200"/></g><g id="Logo__x2014__FIXED"><path class="st1" d="M163.4,305.5c88.7,0,137.2-73.5,137.2-137.2c0-2.1,0-4.2-0.1-6.2c9.4-6.8,17.6-15.3,24.1-25 c-8.6,3.8-17.9,6.4-27.7,7.6c10-6,17.6-15.4,21.2-26.7c-9.3,5.5-19.6,9.5-30.6,11.7c-8.8-9.4-21.3-15.2-35.2-15.2 c-26.6,0-48.2,21.6-48.2,48.2c0,3.8,0.4,7.5,1.3,11c-40.1-2-75.6-21.2-99.4-50.4c-4.1,7.1-6.5,15.4-6.5,24.2 c0,16.7,8.5,31.5,21.5,40.1c-7.9-0.2-15.3-2.4-21.8-6c0,0.2,0,0.4,0,0.6c0,23.4,16.6,42.8,38.7,47.3c-4,1.1-8.3,1.7-12.7,1.7 c-3.1,0-6.1-0.3-9.1-0.9c6.1,19.2,23.9,33.1,45,33.5c-16.5,12.9-37.3,20.6-59.9,20.6c-3.9,0-7.7-0.2-11.5-0.7 C110.8,297.5,136.2,305.5,163.4,305.5"/></g></svg></a> <a href="https://www.linkedin.com/company/oreilly-media" target="_blank"><svg data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32.25 32.25"><defs><style>.cls-1{fill:#E00;fill-rule:evenodd;}</style></defs><title>linkedin-logo</title><path class="cls-1" d="M17.43,13.53v0l0,0ZM16.12,0A16.13,16.13,0,1,0,32.25,16.12,16.12,16.12,0,0,0,16.12,0ZM11.77,22.92H8.12v-11h3.65ZM9.94,10.44h0a1.89,1.89,0,0,1-2-1.89A1.91,1.91,0,0,1,10,6.65a1.9,1.9,0,1,1,0,3.79Zm15,12.48H21.28V17.05c0-1.48-.53-2.49-1.85-2.49a2,2,0,0,0-1.88,1.34,2.63,2.63,0,0,0-.12.89v6.13H13.79s.05-10,0-11h3.64V13.5a3.63,3.63,0,0,1,3.29-1.82c2.4,0,4.21,1.57,4.21,4.95Z"/></svg></a> <a href="https://www.youtube.com/user/OreillyMedia" target="_blank"><svg data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32.25 32.25"><defs><style>.cls-1{fill:#E00;fill-rule:evenodd;}</style></defs><title>youtube-logo</title><path class="cls-1" d="M18.35,18.68a.89.89,0,0,0-.86.63V16.94h-1v7.59h1v-.59a.92.92,0,0,0,.89.74c.52,0,.86-.36,1-1.07a8.56,8.56,0,0,0,.14-1.9,10.47,10.47,0,0,0-.12-1.93C19.21,19.05,18.87,18.68,18.35,18.68Zm.09,4.14c-.05.52-.2.77-.45.77s-.43-.21-.49-.63a7.22,7.22,0,0,1,0-1c0-.72,0-1.14,0-1.26.07-.58.23-.88.51-.88s.4.27.46.79c0,.09,0,.47,0,1.13S18.46,22.71,18.44,22.82ZM8.61,18.19H9.86v6.34H11V18.19H12.2V16.94H8.61Zm7.71-6.12c.27,0,.43-.22.49-.66,0-.09,0-.45,0-1.07V9.78c0-.58,0-.93,0-1-.07-.43-.23-.65-.48-.65s-.41.19-.48.57a8.79,8.79,0,0,0,0,1v.53c0,.71,0,1.09,0,1.16C15.88,11.82,16.05,12.07,16.32,12.07Zm-1.74,10.4a2.92,2.92,0,0,1-.06.71c-.07.25-.2.37-.4.37s-.32-.11-.38-.34a2.63,2.63,0,0,1-.05-.66V18.83h-1v4.48c0,.91.33,1.37,1,1.37A1,1,0,0,0,14.6,24v.57h1v-5.7h-1Zm7.1-3.79a1.35,1.35,0,0,0-1.22.59,2.48,2.48,0,0,0-.3,1.07c0,.23,0,.61,0,1.16s0,1.13,0,1.37a2.93,2.93,0,0,0,.35,1.27,1.25,1.25,0,0,0,1.14.54,1.36,1.36,0,0,0,1.13-.45,2.29,2.29,0,0,0,.37-1.43s0-.07,0-.11v-.12h-1c0,.75-.17,1.12-.51,1.12s-.38-.18-.45-.56a4.68,4.68,0,0,1-.06-.9c0-.18,0-.31,0-.37h2v-.43a4.86,4.86,0,0,0-.3-2.11A1.28,1.28,0,0,0,21.68,18.68ZM22.15,21h-1c0-.05,0-.11,0-.16v-.08a1.64,1.64,0,0,1,.11-.8.39.39,0,0,1,.38-.23.42.42,0,0,1,.43.33,2.32,2.32,0,0,1,.07.7Zm-6-21A16.13,16.13,0,1,0,32.25,16.12,16.12,16.12,0,0,0,16.12,0Zm2.51,7.2h1V11a2.52,2.52,0,0,0,.06.66c.06.23.18.34.38.34s.34-.12.41-.37a3.76,3.76,0,0,0,.05-.71V7.2h1v5.74h-1v-.57a1,1,0,0,1-.93.72c-.66,0-1-.46-1-1.38ZM15,8a1.29,1.29,0,0,1,1.33-.92A1.3,1.3,0,0,1,17.65,8a6.77,6.77,0,0,1,.23,2.1,6.77,6.77,0,0,1-.23,2.1,1.3,1.3,0,0,1-1.32.92A1.29,1.29,0,0,1,15,12.17a6.77,6.77,0,0,1-.23-2.1A6.86,6.86,0,0,1,15,8ZM11.45,5.3l.89,2.87.88-2.87H14.4L12.88,9.7v3.24h-1.1V9.7L10.24,5.3ZM24.93,23.91a3,3,0,0,1-3,3h-12a3,3,0,0,1-3-3V18.05a3,3,0,0,1,3-3h12a3,3,0,0,1,3,3Z"/></svg></a> </div> <div class="footer-international"> <h2 class="footer-header">International</h2> <ul class="footer-links"> <li><a href="https://www.oreilly.com/anz/">Australia & New Zealand</a></li> <li><a href="https://oreilly.hk/">Hong Kong & Taiwan</a></li> <li><a href="https://oreillylearning.in/">India</a></li> <li><a href="https://oreilly.id/">Indonesia</a></li> <li><a href="https://www.oreilly.co.jp/index.shtml">Japan</a></li> </ul> </div> </div> </div> <div class="footer-download" id="download-info"> <h2 class="footer-header">Download the O’Reilly App</h2> <p>Take O’Reilly with you and learn anywhere, anytime on your phone <span class="nowrap">and tablet.</span></p> <div class="footer-downloadLinks"> <a href="https://itunes.apple.com/us/app/safari-to-go/id881697395"><img src="https://cdn.oreillystatic.com/oreilly/images/app-store-logo.png" alt="Apple app store" /></a> <a href="https://play.google.com/store/apps/details?id=com.safariflow.queue"><img src="https://cdn.oreillystatic.com/oreilly/images/google-play-logo.png" alt="Google play store" /></a> </div> </div> <div class="footer-download" id="tv-info"> <h2 class="footer-header">Watch on your big screen</h2> <p>View all O’Reilly videos, Superstream events, and Meet the Expert sessions on your <span class="nowrap">home TV.</span></p> <div class="footer-downloadLinks"> <a href="https://channelstore.roku.com/details/c8a2d0096693eb9455f6ac165003ee06/oreilly"><img src="https://cdn.oreillystatic.com/oreilly/images/roku-tv-logo.png" alt="Roku Payers and TVs" /></a> <a href="https://www.amazon.com/OReilly-Media-Inc/dp/B087YYHL5C/ref=sr_1_2?dchild=1&keywords=oreilly&qid=1604964116&s=mobile-apps&sr=1-2"><img src="https://cdn.oreillystatic.com/oreilly/images/amazon-appstore-logo.png" alt="Amazon appstore" /></a> </div> </div> <div class="footer-donotsell" id="donotsell-info"> <h2 class="footer-header"><a href="https://www.oreilly.com/privacy.html?donotsell=show">Do not sell my personal information</a></h2> </div> </div> <div class="footer-subfooter"> <a href="https://www.oreilly.com" title="home page" aria-current="page"> <img class="footer-subfooterLogo" id="footer-subfooterLogo" src="https://cdn.oreillystatic.com/images/sitewide-headers/oreilly_logo_mark_red.svg" onerror="this.src='https://cdn.oreillystatic.com/images/sitewide-headers/oreilly_logo_mark_red_@2x.png'; this.onerror=null;" alt="O'Reilly home"> </a> <p>© 2024, O’Reilly Media, Inc. All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.</p> <p>We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.</p> <p><a href="https://www.oreilly.com/terms/">Terms of service</a> • <a href="https://www.oreilly.com/privacy.html">Privacy policy</a> • <a href="https://www.oreilly.com/about/editorial_independence.html">Editorial independence</a></p> </div> </div> </footer> <div class="exitIntentOverlay" id="exitIntentOverlay"> <div class="exitIntentOverlay-contents"> <div class="exitIntentOverlay-columns"> <div class="exitIntentOverlay-text"> <h2>Don’t leave <span class="nowrap">empty-handed</span></h2> <p>Get Mark Richards’s <em>Software Architecture Patterns</em> ebook to better understand how to design components—and how they should interact.</p> <h3>It’s yours, free.</h3> <a class="exitIntentOverlay-cta" href="https://get.oreilly.com/ind_software-architecture-patterns.html">Get it now</a> </div> <figure class="exitIntentOverlay-figure"><img src="https://cdn.oreillystatic.com/oreilly/images/report-software-architecture-patterns-553x420.jpg" alt="Cover of Software Architecture Patterns"></figure> </div> <button class="exitIntentOverlay-close">Close</button> </div> </div> <div class="exitIntentOverlay2" id="exitIntentOverlay2"> <div class="exitIntentOverlay-contents"> <div class="exitIntentOverlay-columns"> <div class="exitIntentOverlay-text"> <h2>Check it out now <span class="nowrap">on O’Reilly</span></h2> <p>Dive in for free with a 10-day trial of the O’Reilly learning platform—then explore all the other resources our members count on to build skills and solve problems <span class="nowrap">every day.</span></p> <a id="exitIntentOverlay2StartYourFreeTrial" class="exitIntentOverlay-cta" href="https://www.oreilly.com/start-trial/">Start your free trial</a> <a class="exitIntentOverlay-cta" href="https://learning.oreilly.com/signup/">Become a member now</a> </div> <figure class="exitIntentOverlay-figure"><img src="https://cdn.oreillystatic.com/oreilly/images/laptop-flat-topics-ml-1124x638.png" alt=""></figure> </div> <button class="exitIntentOverlay-close">Close</button> </div> </div> <script> var g = { }; </script> <script> window.dataLayer = window.dataLayer || []; window.dataLayer.push({ 'product.title': "Make a Mind-Controlled Arduino Robot", 'product.type': "book", 'product.identifier': "9781449312800", 'content.identifier': "9781449312800", 'content.publisher': "O'Reilly Media, Inc.", 'content.free': "no", //'purchase.option': "aerio", 'content.subdirectory': "none", 'content.subTopic': "none", 'content.parentTopic': "none", 'content.formatType': "book", 'content.author': "Tero Karvinen, Kimmo Karvinen", 'content.releaseDate': "2011-12-21", 'content.title': "Make a Mind-Controlled Arduino Robot", }); </script> <script> // Datadog RUM integration to measure performance and Core Web Vitals // https://docs.datadoghq.com/real_user_monitoring/browser/#overview // https://web.dev/vitals/ (function(h,o,u,n,d) { h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}} d=o.createElement(u);d.async=1;d.src=n n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n) })(window,document,'script','https://www.datadoghq-browser-agent.com/datadog-rum.js','DD_RUM') DD_RUM.onReady(function() { DD_RUM.init({ clientToken: 'pub1221d36d3b6dfda5f3c3b7ed22e3b6af', applicationId: '291bce39-f950-4fc6-a610-10abfead0661', site: 'datadoghq.com', service:'anybird', env:'production', // Specify a version number to identify the deployed version of your application in Datadog // version: '1.0.0', sampleRate: 10, trackInteractions: true, }) }) </script> <script> //If aerio=true is a URL parameter, update page content. (function () { if (window.location.search.indexOf('aerio') > -1) { var aerio = new URL(window.location.href).searchParams.get('aerio').toLowerCase(); //Show learning platform text if discount is "learn" if (aerio === 'true') { //Remove content document.getElementById('globalSearchContent').remove(); document.getElementById('titlePromo').remove(); document.getElementById('startTrial').remove(); document.getElementById('buyAmazon').remove(); //Update Aerio button var buyAerio = document.getElementById('buyAerio'); buyAerio.classList.remove('button-secondary'); buyAerio.classList.add('button-primary'); buyAerio.textContent = 'Buy now'; } } })(); </script> <script src="/library/view/static/CACHE/js/output.25e31e23f4a4.js"></script> <noscript> <iframe src="//www.googletagmanager.com/ns.html?id=GTM-5P4V6Z" height="0" width="0" style="display:none;visibility:hidden"> </iframe> </noscript> <script async defer src="/library/view/pageview.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <script src="https://cdn.oreillystatic.com/assets/js/anybird/promotion.js"></script> <script> //Exit intent overlay scripts //Setter and getter for exit intent cookie const ExitIntentCookieService = { setCookie(name, value, days) { let expires = ''; if (days) { const date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); expires = '; expires=' + date.toUTCString(); } document.cookie = name + '=' + (value || '') + expires + ';'; }, getCookie(name) { const cookies = document.cookie.split(';'); for (const cookie of cookies) { if (cookie.indexOf(name + '=') > -1) { return cookie.split('=')[1]; } } return null; } }; //When a user clicks outside overlay or close icon or hits escape key //close exit intent overlay const exit = e => { const shouldExit = [...e.target.classList].includes('exitIntentOverlay') || // user clicks on overlay [...e.target.classList].includes('exitIntentOverlay2') || // user clicks on overlay2 e.target.className === 'exitIntentOverlay-close' || // user clicks on the close icon e.keyCode === 27; // user hits escape if (shouldExit) { document.querySelector('.exitIntentOverlay').classList.remove('visible'); document.querySelector('.exitIntentOverlay2').classList.remove('visible'); } }; //When a user's cursor leaves the document //show exit intent overlay const mouseEvent = e => { const shouldShowExitIntent = !e.toElement && !e.relatedTarget && e.clientY < 10; if (shouldShowExitIntent) { document.removeEventListener('mouseout', mouseEvent); if (exitIntentCookieValue === null) { //Set value of exitIntentCookieValue exitIntentCookieValue = '1'; //make exitIntentOverlay visible document.querySelector('.exitIntentOverlay').classList.add('visible'); //Send tracking for exit intent overlay impression window.dataLayer.push({ 'event': 'eventTracker', 'eventCat': 'marketing', 'eventAct': 'exit intent imp', 'eventLbl': 'modal 1' }); } else if (exitIntentCookieValue === '1') { //Set value of exitIntentCookieValue exitIntentCookieValue = '2'; //make exitIntentOverlay2 visible document.querySelector('.exitIntentOverlay2').classList.add('visible'); //Send tracking for exit intent overlay impression window.dataLayer.push({ 'event': 'eventTracker', 'eventCat': 'marketing', 'eventAct': 'exit intent imp', 'eventLbl': 'modal 2' }); //Add click tracking for "start your free trial" button const StartYourFreeTrial = document.querySelector("#exitIntentOverlay2StartYourFreeTrial"); StartYourFreeTrial.addEventListener('click', function(e) { window.dataLayer.push({ 'event': 'eventTracker', 'eventCat': 'marketing', 'eventAct': 'exit intent', 'eventLbl': 'start your free trial' }); }); } //Set exit intent cookie ExitIntentCookieService.setCookie('libraryExitIntentShown', exitIntentCookieValue, 30); } }; //If exit intentcookie doesn't exist, //then initialize exit intent overlay scripts var exitIntentCookieValue = ExitIntentCookieService.getCookie('libraryExitIntentShown'); if (exitIntentCookieValue === null || exitIntentCookieValue === '1') { setTimeout(() => { document.addEventListener('mouseout', mouseEvent); document.addEventListener('keydown', exit); document.querySelector('.exitIntentOverlay').addEventListener('click', exit); document.querySelector('.exitIntentOverlay2').addEventListener('click', exit); }, 0); } </script> <script> jQuery(document).ready(function($) { //Toggle isActive and mobileHidden classes for mobileNavButton $('nav #mobileNavButton').on('click', function() { var expanded = $(this).attr('aria-expanded') === 'true' || false; $(this).attr('aria-expanded', !expanded); $(this).toggleClass("isActive"); $(this).next().toggleClass("mobileHidden"); }); //Toggle isFocused class for keyboard navigation of submenus $('nav #menuList .menuList-subItem a').each(function(navItem) { $(this).on('focus', function() { $(this).parent().parent().toggleClass('isFocused'); }); $(this).on('blur', function() { $(this).parent().parent().toggleClass('isFocused'); }); }); //Toggle mobileHidden class accordian elements $('.mobileAccordian').each(function() { var $btn = $(this).find('button'); var $target = $(this).next(); $btn.on('click', function() { var expanded = $btn.attr('aria-expanded') === 'true' || false; $btn.attr('aria-expanded', !expanded); $target.toggleClass("mobileHidden"); }); }); //Hide title page's long description behind disclosure button var titleDescriptionExtra = $('.title-description p:first-of-type').nextAll(':nth-child(3)').nextAll(); titleDescriptionExtra.wrapAll('<div id="titleDescriptionExtra" />'); if (titleDescriptionExtra.length > 0) { $('#titleDescriptionExtra').toggle(); $('#showMoreDescription').removeClass('hidden'); $('#showMoreDescription button').on('click', function() { $(this).toggleClass('more'); $('#titleDescriptionExtra').slideToggle(); }); } //Hide title page's long TOC behind disclosure button var titleTOCShort = $('.sbo-reader-title .detail-toc').find('li').slice(0,4); var titleTOCExtra = $('.sbo-reader-title .detail-toc').find('li').not(titleTOCShort); if (titleTOCExtra.length > 0) { titleTOCExtra.toggle(); $('#showMoreTOC').removeClass('hidden'); $('#showMoreTOC button').on('click', function() { $(this).toggleClass('more'); titleTOCExtra.toggle(); }); } //Hide product information on page load $('#product-information').toggle(); $('#title-tabs button').on('click', function() { var $thisTab = $(this); if (!$thisTab.hasClass('title-tab-active')) { var lastTabTarget = $('#title-tabs .title-tab-active').removeClass('title-tab-active').attr('data-target'); $('#' + lastTabTarget).toggle(); $thisTab.addClass('title-tab-active'); var $tabTarget = $(this).attr('data-target'); $('#' + $tabTarget).toggle(); } }); // Append highlight fragment hash to sign in link for highlighting if (window.location.hash.indexOf('#:-:text') > -1) { // encode the hash symbol to prevent it from being used as a location hash by groot-fe var highlightFragment = window.location.hash.replace('#:-:text', '%23:-:text'); $('#chapter-sign-in').attr('href', $('#chapter-sign-in').attr('href') + highlightFragment); } //Trigger GA events for related products $('#recommendations .recommendations-item').each(function(i) { $(this).on('click', function(e) { var cardTitle = $(this).find('.recommendations-title').text().toLowerCase(); var productType = $(this).find('.recommendations-format').text().toLowerCase(); var contentID = $(this).attr('data-id'); var eventLbl = String(i); dataLayer.push({ 'product.title': undefined, 'content.formatType': undefined, 'product.identifier': undefined, 'content.title': undefined, 'content.author': undefined, 'content.publisher': undefined, 'content.releaseDate': undefined, 'content.free': undefined, 'content.subdirectory': undefined, 'content.parentTopic': undefined, 'content.subTopic': undefined, 'event': 'eventTracker', 'eventCat': 'recommended titles', 'eventAct': 'card click', 'eventLbl': eventLbl, 'eventVal': 0, 'nonInteraction': 0, 'cardTitle': cardTitle, 'product.type': productType, 'content.identifier': contentID, 'eventCallback': function() { dataLayer.push({'cardTitle': undefined}); }, 'eventTimeout' : 2000 }); }); }); //Trigger GA event for "Try Now" nav button $('.menuList-tryNow > a').on('click', function() { dataLayer.push({ 'event': 'eventTracker', 'eventCat':'marketing', 'eventAct':'nav', 'eventLbl':'try now', 'eventVal':0, 'nonInteraction': 0, }); }); //Trigger GA event for "Sign In" nav button $('.menuList-signIn > a').on('click', function() { dataLayer.push({ 'event': 'eventTracker', 'eventCat':'marketing', 'eventAct':'nav', 'eventLbl':'sign in', 'eventVal':0, 'nonInteraction': 0, }); }); }); </script> <!-- MARC Intercept Support --> <script src="https://service.seamlessaccess.org/thiss.js"></script> <script type="text/javascript" src="/bdxdF5/wgY/XHI/Eb9JVw/aYLOwNS2r4zN/WRZ9AQ/HAN/pekpRbB4"></script><link rel="stylesheet" type="text/css" href="/bdxdF5/wgY/XHI/Eb9JVw/GG/clJdAQ/JHU/DIC4SMDVX"> <script src="/bdxdF5/wgY/XHI/Eb9JVw/GG/clJdAQ/WDg/cLU9Qdy4p" async defer></script> <div id="sec-overlay" style="display:none;"> <div id="sec-container"> </div> </div></body> </html>