{"appState":{"pageLoadApiCallsStatus":true},"categoryState":{"relatedCategories":{"headers":{"timestamp":"2025-04-17T16:01:05+00:00"},"categoryId":33519,"data":{"title":"Raspberry Pi","slug":"raspberry-pi","image":{"src":null,"width":0,"height":0},"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Computers","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33513"},"slug":"computers","categoryId":33513},{"name":"Hardware","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33516"},"slug":"hardware","categoryId":33516},{"name":"Raspberry Pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"},"slug":"raspberry-pi","categoryId":33519}],"parentCategory":{"categoryId":33516,"title":"Hardware","slug":"hardware","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33516"}},"childCategories":[],"description":"Get started with the sweetest little computer around. Then, try a helping of the advanced stuff, like facial recognition, programming, and IoT projects.","relatedArticles":{"self":"https://dummies-api.dummies.com/v2/articles?category=33519&offset=0&size=5"},"hasArticle":true,"hasBook":true,"articleCount":36,"bookCount":3},"_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"}},"relatedCategoriesLoadedStatus":"success"},"listState":{"list":{"count":10,"total":36,"items":[{"headers":{"creationTime":"2016-03-27T16:47:43+00:00","modifiedTime":"2022-03-14T18:13:51+00:00","timestamp":"2022-09-14T18:19:25+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Computers","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33513"},"slug":"computers","categoryId":33513},{"name":"Hardware","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33516"},"slug":"hardware","categoryId":33516},{"name":"Raspberry Pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"},"slug":"raspberry-pi","categoryId":33519}],"title":"Raspberry Pi For Dummies Cheat Sheet","strippedTitle":"raspberry pi for dummies cheat sheet","slug":"raspberry-pi-for-dummies-cheat-sheet","canonicalUrl":"","seo":{"metaDescription":"Learn how to find and install great free software on your Raspberry Pi as well as how to program in Scratch.","noIndex":0,"noFollow":0},"content":"The Raspberry Pi is perhaps the most inspiring computer available today. It comes with the tools you need to start making your own software, and you can connect your own electronic inventions to it. These tips show you how to discover and install great free software on your Raspberry Pi and how to program in Scratch.","description":"The Raspberry Pi is perhaps the most inspiring computer available today. It comes with the tools you need to start making your own software, and you can connect your own electronic inventions to it. These tips show you how to discover and install great free software on your Raspberry Pi and how to program in Scratch.","blurb":"","authors":[{"authorId":9304,"name":"Sean McManus","slug":"sean-mcmanus","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9304"}},{"authorId":9222,"name":"Mike Cook","slug":"mike-cook","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9222"}}],"primaryCategoryTaxonomy":{"categoryId":33519,"title":"Raspberry Pi","slug":"raspberry-pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":[{"articleId":192609,"title":"How to Pray the Rosary: A Comprehensive Guide","slug":"how-to-pray-the-rosary","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/192609"}},{"articleId":208741,"title":"Kabbalah For Dummies Cheat Sheet","slug":"kabbalah-for-dummies-cheat-sheet","categoryList":["body-mind-spirit","religion-spirituality","kabbalah"],"_links":{"self":"/articles/208741"}},{"articleId":230957,"title":"Nikon D3400 For Dummies Cheat Sheet","slug":"nikon-d3400-dummies-cheat-sheet","categoryList":["home-auto-hobbies","photography"],"_links":{"self":"/articles/230957"}},{"articleId":235851,"title":"Praying the Rosary and Meditating on the Mysteries","slug":"praying-rosary-meditating-mysteries","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/235851"}},{"articleId":284787,"title":"What Your Society Says About You","slug":"what-your-society-says-about-you","categoryList":["academics-the-arts","humanities"],"_links":{"self":"/articles/284787"}}],"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":246452,"title":"How to Set Up the Media Center on Your Raspberry Pi","slug":"set-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246452"}},{"articleId":246448,"title":"Navigating the Media Center on Your Raspberry Pi","slug":"navigating-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246448"}},{"articleId":246445,"title":"How to Change the Settings on Your Raspberry Pi","slug":"change-settings-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246445"}},{"articleId":246442,"title":"How to Use Music Samples on Your Raspberry Pi","slug":"use-music-samples-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246442"}},{"articleId":246439,"title":"How to Use Python to Access GPIO Pins on Your Raspberry Pi","slug":"use-python-access-gpio-pins-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246439"}}],"fromCategory":[{"articleId":246452,"title":"How to Set Up the Media Center on Your Raspberry Pi","slug":"set-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246452"}},{"articleId":246448,"title":"Navigating the Media Center on Your Raspberry Pi","slug":"navigating-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246448"}},{"articleId":246445,"title":"How to Change the Settings on Your Raspberry Pi","slug":"change-settings-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246445"}},{"articleId":246442,"title":"How to Use Music Samples on Your Raspberry Pi","slug":"use-music-samples-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246442"}},{"articleId":246439,"title":"How to Use Python to Access GPIO Pins on Your Raspberry Pi","slug":"use-python-access-gpio-pins-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246439"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281848,"slug":"raspberry-pi-for-dummies","isbn":"9781119796824","categoryList":["technology","computers","hardware","raspberry-pi"],"amazon":{"default":"https://www.amazon.com/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119796822-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/raspberry-pi-for-dummies-4e-cover-9781119796824-203x255.jpg","width":203,"height":255},"title":"Raspberry Pi For Dummies","testBankPinActivationLink":"","bookOutOfPrint":true,"authorsInfo":"<p><b><b data-author-id=\"9304\">Sean McManus</b> </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p> <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b><b data-author-id=\"9222\">Mike Cook</b> </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","authors":[{"authorId":9304,"name":"Sean McManus","slug":"sean-mcmanus","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9304"}},{"authorId":9222,"name":"Mike Cook","slug":"mike-cook","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9222"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;computers&quot;,&quot;hardware&quot;,&quot;raspberry-pi&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119796824&quot;]}]\" id=\"du-slot-63221b2d14689\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;computers&quot;,&quot;hardware&quot;,&quot;raspberry-pi&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119796824&quot;]}]\" id=\"du-slot-63221b2d15002\"></div></div>"},"articleType":{"articleType":"Cheat Sheet","articleList":[{"articleId":147468,"title":"How to Install Games and Other Software on the Raspberry Pi","slug":"how-to-install-games-and-other-software-on-the-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/147468"}},{"articleId":147474,"title":"Programming in Scratch","slug":"programming-in-scratch","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/147474"}}],"content":[{"title":"How to install games and other software on the Raspberry Pi","thumb":null,"image":null,"content":"<p>You can discover new software to install using the command line, but there&#8217;s also a friendly menu system you can use in the desktop environment. On the Applications menu, hover over the Preferences option and click Add/Remove Software to get started. You need to have an active Internet connection.</p>\n<p>The menu looks like this:</p>\n<p><a href=\"https://www.dummies.com/wp-content/uploads/raspberry-pi-add-remove.jpg\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-244250\" src=\"https://www.dummies.com/wp-content/uploads/raspberry-pi-add-remove.jpg\" alt=\"raspberry-pi-add-remove\" width=\"535\" height=\"337\" /></a></p>\n<p>In the top left is a search box, where you can enter the name of a program you&#8217;re looking for, or a phrase such as <em>puzzle games</em> to explore what&#8217;s available. On the left are categories you can click to see your options.</p>\n<p>The main pane shows you the packages, with a scrollbar on the right that you can use to see the full list. Those that are already checked (or <em>ticked</em>) and shown in bold are already installed on your Raspberry Pi. You can click a package to see its description below. To select a package for installation, tick the box beside it. To remove it, untick it.</p>\n<p>When you&#8217;ve finished choosing your software, click the OK button to install and remove the applications. You will be prompted to enter your password (which is <em>raspberry</em>, unless you&#8217;ve changed it). It can take some time to download and install the software, so it&#8217;s a good idea to choose a few applications and leave them to install in one batch while you do something else.</p>\n<p>The menu ensures that any applications that your chosen application requires also get installed. When you install the puzzle game Brain Party, for example, the menu automatically installed its separate data package for you.</p>\n<p>Your software is now installed! You should be able to run it either from the shell by entering its name (for example, penguinspuzzle), or through your Applications menu in the desktop environment.</p>\n<p>The menu makes it easy to install software, but you might find that not all the software works well on the Raspberry Pi. It&#8217;s easy enough to try something, though, and remove it if it doesn&#8217;t do what you need. It&#8217;s all free.</p>\n"},{"title":"Programming in Scratch","thumb":null,"image":null,"content":"<p>The Raspberry Pi was created partly to inspire the next generation of programmers, and Scratch is the perfect place to start. With it, you can make your own cartoons and games and discover some of the concepts that professional programmers use every day.</p>\n<p>Scratch is designed to be approachable for people of all ages. The visual interface makes it easy to see what you can do at any time without having to remember any strange codes, and you can rapidly achieve great results. Scratch comes with a library of images and sounds, so it only takes a few minutes to write your first Scratch program.</p>\n<h2>The Scratch screen layout</h2>\n<p>There are two versions of Scratch installed in Raspbian:</p>\n<ul>\n<li><strong>Scratch:</strong> This is the original version of Scratch, widely known as Scratch 1.4. If you&#8217;re a newcomer to Scratch, we recommend you start by using the original Scratch, because your programs will run much more quickly.</li>\n<li><strong>Scratch 2:</strong> This adds some features that are not available in the original Scratch, including the ability for sprites (which are, roughly speaking, game characters) to create copies of themselves, and a feature to make your own blocks (or instructions). Because Scratch 2 requires the Flash software to work, it only runs on the Raspberry Pi 2 and Raspberry Pi 3. Some programs, especially action games, run significantly slower in this version of Scratch, because of all the layers of software required to run Flash on the Raspberry Pi. Simple programs will run fine, but if you want to make games you will soon notice a performance difference.</li>\n</ul>\n<p><a href=\"https://www.dummies.com/wp-content/uploads/raspberry-pi-scratch.jpg\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-244254\" src=\"https://www.dummies.com/wp-content/uploads/raspberry-pi-scratch.jpg\" alt=\"raspberry-pi-scratch\" width=\"535\" height=\"384\" /></a></p>\n<p>Scratch divides the screen into four main areas. The Stage is where you can see your game or animation take shape. There&#8217;s a cat on it already, so you can get started straightaway by making it do things, as you see in a minute. In Scratch, the Stage is in the top right, and in Scratch 2, it&#8217;s in the top left.</p>\n<p>Underneath the Stage is your Sprite List. You can think of sprites as the characters in your game. They&#8217;re images that you can make do things, such as move around or change their appearance. For now, there&#8217;s just the cat, which has the name Sprite1 in Scratch and Cat1 in Scratch 2.</p>\n<p>You create a Scratch program by snapping together <em>blocks</em>, which are short instructions. You find the blocks in the Blocks palette, which is on the left in Scratch and in the middle in Scratch 2. In both cases, it displays the Motion blocks by default. They include instructions to move ten steps, rotate, go to a particular grid reference, and point in a particular direction.</p>\n<p>The Scripts area is where the magic happens! You assemble your program in this space, by dragging blocks into it from the Blocks Palette. The Scripts area is in the middle in the original Scratch, and on the right in Scratch 2.</p>\n<p><a href=\"https://www.dummies.com/wp-content/uploads/raspberry-pi-scripts.jpg\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-244255\" src=\"https://www.dummies.com/wp-content/uploads/raspberry-pi-scripts.jpg\" alt=\"raspberry-pi-scripts\" width=\"535\" height=\"382\" /></a></p>\n<h2>Making your sprite move under keyboard control</h2>\n<p>You can make this simple example using either version of Scratch.</p>\n<p>To make your sprite move under keyboard control, assemble the program in the following figure. You need to click the Control button above the Blocks Palette to view the yellow blocks, and the Motion button to see the blocks to change the x and y coordinates. The keyboard control block is called When [space] Key Pressed, and you can click where it says [space] to change that to a different key. The movement blocks to change the x and y position have the number 10 in them by default, but you can click in the box and type your chosen number.</p>\n<p><a href=\"https://www.dummies.com/wp-content/uploads/raspberry-pi-sprite.jpg\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-244256\" src=\"https://www.dummies.com/wp-content/uploads/raspberry-pi-sprite.jpg\" alt=\"raspberry-pi-sprite\" width=\"300\" height=\"423\" /></a></p>\n<h2>Adding a bouncing ball</h2>\n<p>There are three or four New Sprite buttons above the Sprite List. In Scratch, the middle button, which shows a folder on a star, is for choosing a new sprite from a file. In Scratch 2.0, the first button with a spiky-haired character on it is for choosing a new sprite from the library. Click the button and use the file browser to find a ball sprite in the Things folder.</p>\n<p>Now you have two sprites in the Sprite List. To choose which one you add blocks to, you click it first. Click the ball in the Sprite List (not on the Stage) to make sure it’s selected.</p>\n<p>Then add the program in the following figure.</p>\n<p><a href=\"https://www.dummies.com/wp-content/uploads/raspberry-pi-ball.jpg\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-244257\" src=\"https://www.dummies.com/wp-content/uploads/raspberry-pi-ball.jpg\" alt=\"raspberry-pi-ball\" width=\"344\" height=\"294\" /></a></p>\n<p>When you click the green flag above the Stage to start your program, the ball will start bouncing from left to right and back again, and you can move the cat to try to cross its path without getting hit. Well done! You’ve made your first simple game!</p>\n<h2>Online Scratch resources</h2>\n<p>For more help with Scratch, see the following links:</p>\n<ul>\n<li><a href=\"http://wiki.scratch.mit.edu/wiki/Scratch_Wiki\">Scratch Wiki</a>: The Scratch Wiki is a community resource that includes documentation of all the Scratch blocks.</li>\n<li><a href=\"http://www.sean.co.uk/books/scratch-programming-in-easy-steps/10-block-demos.shtm\">10 Block Demos</a>: What can you do with Scratch in 10 blocks or fewer? These simple examples by Sean McManus, co-author of <em>Raspberry Pi For Dummies, 3rd Edition</em>, show you how to make a password, make a sprite explode, draw any shape, and more.</li>\n<li><a href=\"http://www.sean.co.uk/books/scratch-programming-in-easy-steps/debugging-scratch-programs.shtm\">Debugging Scratch programs</a>: Some tips on the most common bugs in Scratch programs and how you can find them.</li>\n<li><a href=\"http://projects.codeclubworld.org/en-GB/index.html\">Code Club Scratch Projects</a>: Code Club provides project tutorials that are typically used in schools, but you can use them at home too.</li>\n<li><a href=\"http://scratched.gse.harvard.edu/\">ScratchEd</a>: A site for educators that includes lots of links to example Scratch projects and other resources.</li>\n</ul>\n"}],"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":"Two years","lifeExpectancySetFrom":"2022-03-14T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":207610},{"headers":{"creationTime":"2017-11-08T12:35:45+00:00","modifiedTime":"2017-11-08T12:35:45+00:00","timestamp":"2022-09-14T18:15:58+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Computers","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33513"},"slug":"computers","categoryId":33513},{"name":"Hardware","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33516"},"slug":"hardware","categoryId":33516},{"name":"Raspberry Pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"},"slug":"raspberry-pi","categoryId":33519}],"title":"How to Set Up the Media Center on Your Raspberry Pi","strippedTitle":"how to set up the media center on your raspberry pi","slug":"set-media-center-raspberry-pi","canonicalUrl":"","seo":{"metaDescription":"The Raspberry Pi can play back full HD 1080p video, which makes it ideal as the heart of a cheap and low-powered media center. The NOOBS software includes two L","noIndex":0,"noFollow":0},"content":"The Raspberry Pi can play back full HD 1080p video, which makes it ideal as the heart of a cheap and low-powered media center. The NOOBS software includes two Linux distributions, both based on Kodi, that turn your Raspberry Pi into a media center. The choices are OSMC and LibreELEC.\r\n\r\nBecause they’re both based on the Kodi core, they have many similarities. LibreELEC uses the default Kodi design (or <em>skin</em>), so it's more likely to resemble other Kodi systems you have used. It's also a more lightweight option, so it may perform better on lower-powered Raspberry Pi models.\r\n\r\nTo make it easier, you can choose the default Kodi skin by clicking Settings on the left, choosing Interface from the menu that appears, and then choosing Skin. Click Skin in the main part of the screen to open the options and choose Estuary, which is the Kodi default.\r\n<p class=\"article-tips tip\">You can change back to the OSMC skin from Estuary by clicking the Cogwheel icon at the top of the menu on the left, choosing Interface Settings from the menu that appears, hovering over Skin on the left, and then clicking Skin in the main part of the screen. You can exit any of the menus by pressing Esc.</p>\r\nTo start setting up your media center, create an SD or MicroSD card with NOOBS Lite on it, and then use that card to install LibreELEC.\r\n\r\nWhen you first boot up LibreELEC, you'll be guided through its main settings, including its name on the network, the network connection itself, and the remote access settings (so that you can access files on your device over the network).","description":"The Raspberry Pi can play back full HD 1080p video, which makes it ideal as the heart of a cheap and low-powered media center. The NOOBS software includes two Linux distributions, both based on Kodi, that turn your Raspberry Pi into a media center. The choices are OSMC and LibreELEC.\r\n\r\nBecause they’re both based on the Kodi core, they have many similarities. LibreELEC uses the default Kodi design (or <em>skin</em>), so it's more likely to resemble other Kodi systems you have used. It's also a more lightweight option, so it may perform better on lower-powered Raspberry Pi models.\r\n\r\nTo make it easier, you can choose the default Kodi skin by clicking Settings on the left, choosing Interface from the menu that appears, and then choosing Skin. Click Skin in the main part of the screen to open the options and choose Estuary, which is the Kodi default.\r\n<p class=\"article-tips tip\">You can change back to the OSMC skin from Estuary by clicking the Cogwheel icon at the top of the menu on the left, choosing Interface Settings from the menu that appears, hovering over Skin on the left, and then clicking Skin in the main part of the screen. You can exit any of the menus by pressing Esc.</p>\r\nTo start setting up your media center, create an SD or MicroSD card with NOOBS Lite on it, and then use that card to install LibreELEC.\r\n\r\nWhen you first boot up LibreELEC, you'll be guided through its main settings, including its name on the network, the network connection itself, and the remote access settings (so that you can access files on your device over the network).","blurb":"","authors":[{"authorId":9304,"name":"Sean McManus","slug":"sean-mcmanus","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9304"}},{"authorId":9222,"name":"Mike Cook","slug":"mike-cook","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9222"}}],"primaryCategoryTaxonomy":{"categoryId":33519,"title":"Raspberry Pi","slug":"raspberry-pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":[{"articleId":192609,"title":"How to Pray the Rosary: A Comprehensive Guide","slug":"how-to-pray-the-rosary","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/192609"}},{"articleId":208741,"title":"Kabbalah For Dummies Cheat Sheet","slug":"kabbalah-for-dummies-cheat-sheet","categoryList":["body-mind-spirit","religion-spirituality","kabbalah"],"_links":{"self":"/articles/208741"}},{"articleId":230957,"title":"Nikon D3400 For Dummies Cheat Sheet","slug":"nikon-d3400-dummies-cheat-sheet","categoryList":["home-auto-hobbies","photography"],"_links":{"self":"/articles/230957"}},{"articleId":235851,"title":"Praying the Rosary and Meditating on the Mysteries","slug":"praying-rosary-meditating-mysteries","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/235851"}},{"articleId":284787,"title":"What Your Society Says About You","slug":"what-your-society-says-about-you","categoryList":["academics-the-arts","humanities"],"_links":{"self":"/articles/284787"}}],"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":246448,"title":"Navigating the Media Center on Your Raspberry Pi","slug":"navigating-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246448"}},{"articleId":246445,"title":"How to Change the Settings on Your Raspberry Pi","slug":"change-settings-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246445"}},{"articleId":246442,"title":"How to Use Music Samples on Your Raspberry Pi","slug":"use-music-samples-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246442"}},{"articleId":246439,"title":"How to Use Python to Access GPIO Pins on Your Raspberry Pi","slug":"use-python-access-gpio-pins-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246439"}},{"articleId":246436,"title":"How to Use GPIO ZERO on Your Raspberry Pi","slug":"use-gpio-zero-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246436"}}],"fromCategory":[{"articleId":246448,"title":"Navigating the Media Center on Your Raspberry Pi","slug":"navigating-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246448"}},{"articleId":246445,"title":"How to Change the Settings on Your Raspberry Pi","slug":"change-settings-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246445"}},{"articleId":246442,"title":"How to Use Music Samples on Your Raspberry Pi","slug":"use-music-samples-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246442"}},{"articleId":246439,"title":"How to Use Python to Access GPIO Pins on Your Raspberry Pi","slug":"use-python-access-gpio-pins-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246439"}},{"articleId":246436,"title":"How to Use GPIO ZERO on Your Raspberry Pi","slug":"use-gpio-zero-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246436"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281848,"slug":"raspberry-pi-for-dummies","isbn":"9781119796824","categoryList":["technology","computers","hardware","raspberry-pi"],"amazon":{"default":"https://www.amazon.com/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119796822-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/raspberry-pi-for-dummies-4e-cover-9781119796824-203x255.jpg","width":203,"height":255},"title":"Raspberry Pi For Dummies","testBankPinActivationLink":"","bookOutOfPrint":true,"authorsInfo":"<p><b><b data-author-id=\"9304\">Sean McManus</b> </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p> <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b><b data-author-id=\"9222\">Mike Cook</b> </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","authors":[{"authorId":9304,"name":"Sean McManus","slug":"sean-mcmanus","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9304"}},{"authorId":9222,"name":"Mike Cook","slug":"mike-cook","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9222"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;computers&quot;,&quot;hardware&quot;,&quot;raspberry-pi&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119796824&quot;]}]\" id=\"du-slot-63221a5e46b4a\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;computers&quot;,&quot;hardware&quot;,&quot;raspberry-pi&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119796824&quot;]}]\" id=\"du-slot-63221a5e473c0\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":null,"lifeExpectancySetFrom":null,"dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":246452},{"headers":{"creationTime":"2017-11-08T12:32:30+00:00","modifiedTime":"2017-11-08T12:32:30+00:00","timestamp":"2022-09-14T18:15:58+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Computers","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33513"},"slug":"computers","categoryId":33513},{"name":"Hardware","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33516"},"slug":"hardware","categoryId":33516},{"name":"Raspberry Pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"},"slug":"raspberry-pi","categoryId":33519}],"title":"Navigating the Media Center on Your Raspberry Pi","strippedTitle":"navigating the media center on your raspberry pi","slug":"navigating-media-center-raspberry-pi","canonicalUrl":"","seo":{"metaDescription":"The Kodi screen on your Raspberry Pi looks like what you see here. LibreELEC uses Kodi’s simple interface, which is designed to work with only a remote control.","noIndex":0,"noFollow":0},"content":"The Kodi screen on your Raspberry Pi looks like what you see here. LibreELEC uses Kodi’s simple interface, which is designed to work with only a remote control. If you’re using a remote control, you should find the interface intuitive.\r\n\r\n[caption id=\"attachment_246449\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-246449 size-full\" src=\"https://www.dummies.com/wp-content/uploads/raspberry-pi-3e-kodi.jpg\" alt=\"Kodi on Raspberry Pi\" width=\"535\" height=\"428\" /> The main menu on the left and the empty library area on the right. This shows how Kodi appears before media is added.[/caption]\r\n\r\nThe menu on the left side of the screen gives you access to the different content types, including movies, TV shows, music, and music videos. When you hover the mouse pointer over one of these options, the main screen area on the right shows you options and submenus for accessing your content.\r\n\r\nThe Music section, for example, shows you categories you can browse, recently played albums, recently added albums, random albums, random artists, unplayed albums, and most played albums. You can use the cursor keys to move around the options; or the mouse, with the scroll wheel moving between the options within a menu. To exit a menu, press the Escape key.\r\n\r\nTo select an item and start to play it, simply click it. You can pause playback by tapping the spacebar, and tap Escape to get back to the menu.\r\n<p class=\"article-tips tech\">To <a href=\"http://kodi.wiki/view/PVR_backend\">use the TV and radio features</a>, you'll need to have a separate tuner device and TV signal decoding software.</p>\r\nAt the top of the menu on the left are buttons for switching off your Pi, accessing the settings menus (the Cogwheel icon), and searching for content (the magnifying glass).","description":"The Kodi screen on your Raspberry Pi looks like what you see here. LibreELEC uses Kodi’s simple interface, which is designed to work with only a remote control. If you’re using a remote control, you should find the interface intuitive.\r\n\r\n[caption id=\"attachment_246449\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-246449 size-full\" src=\"https://www.dummies.com/wp-content/uploads/raspberry-pi-3e-kodi.jpg\" alt=\"Kodi on Raspberry Pi\" width=\"535\" height=\"428\" /> The main menu on the left and the empty library area on the right. This shows how Kodi appears before media is added.[/caption]\r\n\r\nThe menu on the left side of the screen gives you access to the different content types, including movies, TV shows, music, and music videos. When you hover the mouse pointer over one of these options, the main screen area on the right shows you options and submenus for accessing your content.\r\n\r\nThe Music section, for example, shows you categories you can browse, recently played albums, recently added albums, random albums, random artists, unplayed albums, and most played albums. You can use the cursor keys to move around the options; or the mouse, with the scroll wheel moving between the options within a menu. To exit a menu, press the Escape key.\r\n\r\nTo select an item and start to play it, simply click it. You can pause playback by tapping the spacebar, and tap Escape to get back to the menu.\r\n<p class=\"article-tips tech\">To <a href=\"http://kodi.wiki/view/PVR_backend\">use the TV and radio features</a>, you'll need to have a separate tuner device and TV signal decoding software.</p>\r\nAt the top of the menu on the left are buttons for switching off your Pi, accessing the settings menus (the Cogwheel icon), and searching for content (the magnifying glass).","blurb":"","authors":[{"authorId":9304,"name":"Sean McManus","slug":"sean-mcmanus","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9304"}},{"authorId":9222,"name":"Mike Cook","slug":"mike-cook","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9222"}}],"primaryCategoryTaxonomy":{"categoryId":33519,"title":"Raspberry Pi","slug":"raspberry-pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":[{"articleId":192609,"title":"How to Pray the Rosary: A Comprehensive Guide","slug":"how-to-pray-the-rosary","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/192609"}},{"articleId":208741,"title":"Kabbalah For Dummies Cheat Sheet","slug":"kabbalah-for-dummies-cheat-sheet","categoryList":["body-mind-spirit","religion-spirituality","kabbalah"],"_links":{"self":"/articles/208741"}},{"articleId":230957,"title":"Nikon D3400 For Dummies Cheat Sheet","slug":"nikon-d3400-dummies-cheat-sheet","categoryList":["home-auto-hobbies","photography"],"_links":{"self":"/articles/230957"}},{"articleId":235851,"title":"Praying the Rosary and Meditating on the Mysteries","slug":"praying-rosary-meditating-mysteries","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/235851"}},{"articleId":284787,"title":"What Your Society Says About You","slug":"what-your-society-says-about-you","categoryList":["academics-the-arts","humanities"],"_links":{"self":"/articles/284787"}}],"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":246452,"title":"How to Set Up the Media Center on Your Raspberry Pi","slug":"set-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246452"}},{"articleId":246445,"title":"How to Change the Settings on Your Raspberry Pi","slug":"change-settings-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246445"}},{"articleId":246442,"title":"How to Use Music Samples on Your Raspberry Pi","slug":"use-music-samples-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246442"}},{"articleId":246439,"title":"How to Use Python to Access GPIO Pins on Your Raspberry Pi","slug":"use-python-access-gpio-pins-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246439"}},{"articleId":246436,"title":"How to Use GPIO ZERO on Your Raspberry Pi","slug":"use-gpio-zero-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246436"}}],"fromCategory":[{"articleId":246452,"title":"How to Set Up the Media Center on Your Raspberry Pi","slug":"set-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246452"}},{"articleId":246445,"title":"How to Change the Settings on Your Raspberry Pi","slug":"change-settings-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246445"}},{"articleId":246442,"title":"How to Use Music Samples on Your Raspberry Pi","slug":"use-music-samples-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246442"}},{"articleId":246439,"title":"How to Use Python to Access GPIO Pins on Your Raspberry Pi","slug":"use-python-access-gpio-pins-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246439"}},{"articleId":246436,"title":"How to Use GPIO ZERO on Your Raspberry Pi","slug":"use-gpio-zero-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246436"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281848,"slug":"raspberry-pi-for-dummies","isbn":"9781119796824","categoryList":["technology","computers","hardware","raspberry-pi"],"amazon":{"default":"https://www.amazon.com/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119796822-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/raspberry-pi-for-dummies-4e-cover-9781119796824-203x255.jpg","width":203,"height":255},"title":"Raspberry Pi For Dummies","testBankPinActivationLink":"","bookOutOfPrint":true,"authorsInfo":"<p><b><b data-author-id=\"9304\">Sean McManus</b> </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p> <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b><b data-author-id=\"9222\">Mike Cook</b> </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","authors":[{"authorId":9304,"name":"Sean McManus","slug":"sean-mcmanus","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9304"}},{"authorId":9222,"name":"Mike Cook","slug":"mike-cook","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9222"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;computers&quot;,&quot;hardware&quot;,&quot;raspberry-pi&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119796824&quot;]}]\" id=\"du-slot-63221a5e3f212\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;computers&quot;,&quot;hardware&quot;,&quot;raspberry-pi&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119796824&quot;]}]\" id=\"du-slot-63221a5e3fa8c\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":null,"lifeExpectancySetFrom":null,"dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":246448},{"headers":{"creationTime":"2017-11-08T12:18:44+00:00","modifiedTime":"2017-11-08T12:18:44+00:00","timestamp":"2022-09-14T18:15:58+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Computers","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33513"},"slug":"computers","categoryId":33513},{"name":"Hardware","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33516"},"slug":"hardware","categoryId":33516},{"name":"Raspberry Pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"},"slug":"raspberry-pi","categoryId":33519}],"title":"How to Change the Settings on Your Raspberry Pi","strippedTitle":"how to change the settings on your raspberry pi","slug":"change-settings-raspberry-pi","canonicalUrl":"","seo":{"metaDescription":"Need to do some tweaking? You can change the settings on your Raspberry Pi easily enough. The cogwheel at the top of the main menu gives you access to the setti","noIndex":0,"noFollow":0},"content":"Need to do some tweaking? You can change the settings on your Raspberry Pi easily enough. The cogwheel at the top of the main menu gives you access to the settings for Kodi, divided into several sections. They include, among others:\r\n<ul>\r\n \t<li><strong>Player settings,</strong> covering options such as whether the next song or video plays automatically, whether there is cross-fading between songs, and the use of subtitles.</li>\r\n \t<li><strong>Media settings,</strong> which enable you to manage your sources of media in the library and choose information providers for artist and album information.</li>\r\n \t<li><strong>Interface settings,</strong> which enable you to choose a skin (or design) for Kodi, your region, and a screensaver. If you install a screensaver add-on, you'll need to enable it here.</li>\r\n \t<li><strong>System settings,</strong> which can be used to choose the correct audio output device, configure notification sounds in Kodi, and configure power and the Internet connection.</li>\r\n \t<li><strong>LibreELEC,</strong> which includes options for managing the Internet connections available to the system and for enabling Secure Shell (SSH) for remote access to your Pi.</li>\r\n \t<li><strong>File Manager,</strong> which enables you to copy files between different folders and storage devices.</li>\r\n</ul>\r\n<p class=\"article-tips remember\">By default, the sound is set to pass through your HDMI cable. If you want to use your Raspberry Pi’s audio output (and speakers) but you’re using HDMI for your screen, you’ll need to change the audio setting from HDMI to Analog. You’ll find this option on Kodi's System Settings menu. When you’re viewing the settings menu, select Audio on the left and select Audio Output.</p>","description":"Need to do some tweaking? You can change the settings on your Raspberry Pi easily enough. The cogwheel at the top of the main menu gives you access to the settings for Kodi, divided into several sections. They include, among others:\r\n<ul>\r\n \t<li><strong>Player settings,</strong> covering options such as whether the next song or video plays automatically, whether there is cross-fading between songs, and the use of subtitles.</li>\r\n \t<li><strong>Media settings,</strong> which enable you to manage your sources of media in the library and choose information providers for artist and album information.</li>\r\n \t<li><strong>Interface settings,</strong> which enable you to choose a skin (or design) for Kodi, your region, and a screensaver. If you install a screensaver add-on, you'll need to enable it here.</li>\r\n \t<li><strong>System settings,</strong> which can be used to choose the correct audio output device, configure notification sounds in Kodi, and configure power and the Internet connection.</li>\r\n \t<li><strong>LibreELEC,</strong> which includes options for managing the Internet connections available to the system and for enabling Secure Shell (SSH) for remote access to your Pi.</li>\r\n \t<li><strong>File Manager,</strong> which enables you to copy files between different folders and storage devices.</li>\r\n</ul>\r\n<p class=\"article-tips remember\">By default, the sound is set to pass through your HDMI cable. If you want to use your Raspberry Pi’s audio output (and speakers) but you’re using HDMI for your screen, you’ll need to change the audio setting from HDMI to Analog. You’ll find this option on Kodi's System Settings menu. When you’re viewing the settings menu, select Audio on the left and select Audio Output.</p>","blurb":"","authors":[{"authorId":9304,"name":"Sean McManus","slug":"sean-mcmanus","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9304"}},{"authorId":9222,"name":"Mike Cook","slug":"mike-cook","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9222"}}],"primaryCategoryTaxonomy":{"categoryId":33519,"title":"Raspberry Pi","slug":"raspberry-pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":[{"articleId":192609,"title":"How to Pray the Rosary: A Comprehensive Guide","slug":"how-to-pray-the-rosary","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/192609"}},{"articleId":208741,"title":"Kabbalah For Dummies Cheat Sheet","slug":"kabbalah-for-dummies-cheat-sheet","categoryList":["body-mind-spirit","religion-spirituality","kabbalah"],"_links":{"self":"/articles/208741"}},{"articleId":230957,"title":"Nikon D3400 For Dummies Cheat Sheet","slug":"nikon-d3400-dummies-cheat-sheet","categoryList":["home-auto-hobbies","photography"],"_links":{"self":"/articles/230957"}},{"articleId":235851,"title":"Praying the Rosary and Meditating on the Mysteries","slug":"praying-rosary-meditating-mysteries","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/235851"}},{"articleId":284787,"title":"What Your Society Says About You","slug":"what-your-society-says-about-you","categoryList":["academics-the-arts","humanities"],"_links":{"self":"/articles/284787"}}],"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":246452,"title":"How to Set Up the Media Center on Your Raspberry Pi","slug":"set-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246452"}},{"articleId":246448,"title":"Navigating the Media Center on Your Raspberry Pi","slug":"navigating-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246448"}},{"articleId":246442,"title":"How to Use Music Samples on Your Raspberry Pi","slug":"use-music-samples-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246442"}},{"articleId":246439,"title":"How to Use Python to Access GPIO Pins on Your Raspberry Pi","slug":"use-python-access-gpio-pins-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246439"}},{"articleId":246436,"title":"How to Use GPIO ZERO on Your Raspberry Pi","slug":"use-gpio-zero-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246436"}}],"fromCategory":[{"articleId":246452,"title":"How to Set Up the Media Center on Your Raspberry Pi","slug":"set-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246452"}},{"articleId":246448,"title":"Navigating the Media Center on Your Raspberry Pi","slug":"navigating-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246448"}},{"articleId":246442,"title":"How to Use Music Samples on Your Raspberry Pi","slug":"use-music-samples-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246442"}},{"articleId":246439,"title":"How to Use Python to Access GPIO Pins on Your Raspberry Pi","slug":"use-python-access-gpio-pins-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246439"}},{"articleId":246436,"title":"How to Use GPIO ZERO on Your Raspberry Pi","slug":"use-gpio-zero-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246436"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281848,"slug":"raspberry-pi-for-dummies","isbn":"9781119796824","categoryList":["technology","computers","hardware","raspberry-pi"],"amazon":{"default":"https://www.amazon.com/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119796822-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/raspberry-pi-for-dummies-4e-cover-9781119796824-203x255.jpg","width":203,"height":255},"title":"Raspberry Pi For Dummies","testBankPinActivationLink":"","bookOutOfPrint":true,"authorsInfo":"<p><b><b data-author-id=\"9304\">Sean McManus</b> </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p> <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b><b data-author-id=\"9222\">Mike Cook</b> </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","authors":[{"authorId":9304,"name":"Sean McManus","slug":"sean-mcmanus","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9304"}},{"authorId":9222,"name":"Mike Cook","slug":"mike-cook","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9222"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;computers&quot;,&quot;hardware&quot;,&quot;raspberry-pi&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119796824&quot;]}]\" id=\"du-slot-63221a5e37a0b\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;computers&quot;,&quot;hardware&quot;,&quot;raspberry-pi&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119796824&quot;]}]\" id=\"du-slot-63221a5e38278\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":null,"lifeExpectancySetFrom":null,"dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":246445},{"headers":{"creationTime":"2017-11-08T12:15:28+00:00","modifiedTime":"2017-11-08T12:15:28+00:00","timestamp":"2022-09-14T18:15:58+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Computers","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33513"},"slug":"computers","categoryId":33513},{"name":"Hardware","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33516"},"slug":"hardware","categoryId":33516},{"name":"Raspberry Pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"},"slug":"raspberry-pi","categoryId":33519}],"title":"How to Use Music Samples on Your Raspberry Pi","strippedTitle":"how to use music samples on your raspberry pi","slug":"use-music-samples-raspberry-pi","canonicalUrl":"","seo":{"metaDescription":"You can use your Raspberry Pi to compose your own tunes or Sonic Pi can also use samples, which are snippets of music that you can manipulate, such as by changi","noIndex":0,"noFollow":0},"content":"You can use your Raspberry Pi to compose your own tunes or Sonic Pi can also use <em>samples,</em> which are snippets of music that you can manipulate, such as by changing their speed or adding effects to them. Sonic Pi includes a wide range of samples, and you can see a list of them by showing the Help pane and then using the Sample button in the bottom left. They're especially useful for adding drum loops to your music.\r\n\r\nHere’s a favorite:\r\n\r\n<code>sample :loop_industrial</code>\r\n\r\nPut that into a new buffer and click Run to hear it. You can speed it up or slow it down by changing its rate. Here’s how you make it play at half its normal speed:\r\n\r\n<code>sample :loop_industrial, rate: 0.5</code>\r\n\r\nYou can repeat that sample to make a continuous rhythm. Similar to composing your own music, you can use the <code>sleep</code> command to put a pause between each repetition. Samples can be different lengths, however, which can make it difficult to work out how long to sleep. Luckily, Sonic Pi provides a feature in the language to stretch a sample over a certain number of beats, which solves this problem. You can use it like this:\r\n\r\n<code>loop do</code>\r\n\r\n<code>sample :loop_industrial, beat_stretch: 2</code>\r\n\r\n<code>sleep 2</code>\r\n\r\n<code>end</code>\r\n\r\nNow the sample is stretched over 2 beats, and there is a 2-beat pause between each repetition. As a result, you can hear a continuous rhythm. As you saw when experimenting with live loops, you can change the tempo with the <code>use_bpm</code> command.","description":"You can use your Raspberry Pi to compose your own tunes or Sonic Pi can also use <em>samples,</em> which are snippets of music that you can manipulate, such as by changing their speed or adding effects to them. Sonic Pi includes a wide range of samples, and you can see a list of them by showing the Help pane and then using the Sample button in the bottom left. They're especially useful for adding drum loops to your music.\r\n\r\nHere’s a favorite:\r\n\r\n<code>sample :loop_industrial</code>\r\n\r\nPut that into a new buffer and click Run to hear it. You can speed it up or slow it down by changing its rate. Here’s how you make it play at half its normal speed:\r\n\r\n<code>sample :loop_industrial, rate: 0.5</code>\r\n\r\nYou can repeat that sample to make a continuous rhythm. Similar to composing your own music, you can use the <code>sleep</code> command to put a pause between each repetition. Samples can be different lengths, however, which can make it difficult to work out how long to sleep. Luckily, Sonic Pi provides a feature in the language to stretch a sample over a certain number of beats, which solves this problem. You can use it like this:\r\n\r\n<code>loop do</code>\r\n\r\n<code>sample :loop_industrial, beat_stretch: 2</code>\r\n\r\n<code>sleep 2</code>\r\n\r\n<code>end</code>\r\n\r\nNow the sample is stretched over 2 beats, and there is a 2-beat pause between each repetition. As a result, you can hear a continuous rhythm. As you saw when experimenting with live loops, you can change the tempo with the <code>use_bpm</code> command.","blurb":"","authors":[{"authorId":9304,"name":"Sean McManus","slug":"sean-mcmanus","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9304"}},{"authorId":9222,"name":"Mike Cook","slug":"mike-cook","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9222"}}],"primaryCategoryTaxonomy":{"categoryId":33519,"title":"Raspberry Pi","slug":"raspberry-pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":[{"articleId":192609,"title":"How to Pray the Rosary: A Comprehensive Guide","slug":"how-to-pray-the-rosary","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/192609"}},{"articleId":208741,"title":"Kabbalah For Dummies Cheat Sheet","slug":"kabbalah-for-dummies-cheat-sheet","categoryList":["body-mind-spirit","religion-spirituality","kabbalah"],"_links":{"self":"/articles/208741"}},{"articleId":230957,"title":"Nikon D3400 For Dummies Cheat Sheet","slug":"nikon-d3400-dummies-cheat-sheet","categoryList":["home-auto-hobbies","photography"],"_links":{"self":"/articles/230957"}},{"articleId":235851,"title":"Praying the Rosary and Meditating on the Mysteries","slug":"praying-rosary-meditating-mysteries","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/235851"}},{"articleId":284787,"title":"What Your Society Says About You","slug":"what-your-society-says-about-you","categoryList":["academics-the-arts","humanities"],"_links":{"self":"/articles/284787"}}],"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":246452,"title":"How to Set Up the Media Center on Your Raspberry Pi","slug":"set-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246452"}},{"articleId":246448,"title":"Navigating the Media Center on Your Raspberry Pi","slug":"navigating-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246448"}},{"articleId":246445,"title":"How to Change the Settings on Your Raspberry Pi","slug":"change-settings-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246445"}},{"articleId":246439,"title":"How to Use Python to Access GPIO Pins on Your Raspberry Pi","slug":"use-python-access-gpio-pins-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246439"}},{"articleId":246436,"title":"How to Use GPIO ZERO on Your Raspberry Pi","slug":"use-gpio-zero-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246436"}}],"fromCategory":[{"articleId":246452,"title":"How to Set Up the Media Center on Your Raspberry Pi","slug":"set-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246452"}},{"articleId":246448,"title":"Navigating the Media Center on Your Raspberry Pi","slug":"navigating-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246448"}},{"articleId":246445,"title":"How to Change the Settings on Your Raspberry Pi","slug":"change-settings-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246445"}},{"articleId":246439,"title":"How to Use Python to Access GPIO Pins on Your Raspberry Pi","slug":"use-python-access-gpio-pins-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246439"}},{"articleId":246436,"title":"How to Use GPIO ZERO on Your Raspberry Pi","slug":"use-gpio-zero-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246436"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281848,"slug":"raspberry-pi-for-dummies","isbn":"9781119796824","categoryList":["technology","computers","hardware","raspberry-pi"],"amazon":{"default":"https://www.amazon.com/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119796822-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/raspberry-pi-for-dummies-4e-cover-9781119796824-203x255.jpg","width":203,"height":255},"title":"Raspberry Pi For Dummies","testBankPinActivationLink":"","bookOutOfPrint":true,"authorsInfo":"<p><b><b data-author-id=\"9304\">Sean McManus</b> </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p> <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b><b data-author-id=\"9222\">Mike Cook</b> </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","authors":[{"authorId":9304,"name":"Sean McManus","slug":"sean-mcmanus","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9304"}},{"authorId":9222,"name":"Mike Cook","slug":"mike-cook","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9222"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;computers&quot;,&quot;hardware&quot;,&quot;raspberry-pi&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119796824&quot;]}]\" id=\"du-slot-63221a5e305cf\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;computers&quot;,&quot;hardware&quot;,&quot;raspberry-pi&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119796824&quot;]}]\" id=\"du-slot-63221a5e30e41\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":null,"lifeExpectancySetFrom":null,"dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":246442},{"headers":{"creationTime":"2017-11-08T12:10:46+00:00","modifiedTime":"2017-11-08T12:10:46+00:00","timestamp":"2022-09-14T18:15:58+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Computers","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33513"},"slug":"computers","categoryId":33513},{"name":"Hardware","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33516"},"slug":"hardware","categoryId":33516},{"name":"Raspberry Pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"},"slug":"raspberry-pi","categoryId":33519}],"title":"How to Use Python to Access GPIO Pins on Your Raspberry Pi","strippedTitle":"how to use python to access gpio pins on your raspberry pi","slug":"use-python-access-gpio-pins-raspberry-pi","canonicalUrl":"","seo":{"metaDescription":"You can access GPIO pins on your Raspberry Pi with Python. Unlike Scratch's graphic-based program blocks, Python uses entirely text-based instructions. Its grea","noIndex":0,"noFollow":0},"content":"You can access GPIO pins on your Raspberry Pi with Python. Unlike Scratch's graphic-based program blocks, Python uses entirely text-based instructions. Its great power is that the basic Python language can be extended to do more things by the use of <em>libraries.</em> These are functions that can be written in Python or any other language to extend what Python can do.\r\n\r\nWhen using Python to access the GPIO pins, you have a number of different libraries you could choose that can give you access to them. They can provide not only normal input/output access but also access to some of the special functions or capabilities of certain pins.\r\n<p class=\"article-tips remember\">In the early days of the Raspberry Pi, the only access to the GPIO pins was if you were running in Supervisor, or Root, mode. Fortunately, this has now been changed so that you can run in normal User mode with most libraries.</p>\r\nWhile the newly introduced Thonny Python IDE (<em>I</em>ntegrated <em>D</em>evelopment <em>E</em>nvironment) is popular with beginners, our preferred environment for writing Python is IDLE3 (it has more features), but either can be used. IDLE3 and Thonny can both be accessed from the main Desktop Raspberry menu. So, pick the one of your choice and create a new file, and then type in the program you see below. Remember that, in Python, the case of a word matters as does the spaces at the start of a line, so be sure to get them right; otherwise, you will get errors when trying to run your code.\r\n\r\n<code>#!/usr/bin/python3</code>\r\n\r\n<code>import time</code>\r\n\r\n<code>import RPi.GPIO as io # using RPi.GPIO</code>\r\n\r\n \r\n\r\n<code>io.setmode(io.BCM)</code>\r\n\r\n<code>io.setup(4,io.OUT) # make pin into an output</code>\r\n\r\n \r\n\r\n<code>print(\"LED blinker - By Mike Cook\")</code>\r\n\r\n<code>print(\"Ctrl C to quit\")</code>\r\n\r\n<code>while True:</code>\r\n\r\n<code>io.output(4,0)</code>\r\n\r\n<code>time.sleep(0.30)</code>\r\n\r\n<code>io.output(4,1)</code>\r\n\r\n<code>time.sleep(0.30)</code>\r\n\r\nSave the file and run it. Your LED blinks just like the Scratch example.\r\n\r\nTake a look at the code line by line. The program starts by importing the support packages you need. In this case, it’s the time package used to achieve a Delay, or Wait, function, and the RPi.GPIO package to access the GPIO pins. Note here that a lot of examples use <code>as GPIO</code> in the <code>import</code> statement — but you can use the simpler and shorter <code>as io</code> because it reduces the amount of typing and you don't have to keep switching to uppercase.\r\n\r\nThen you have to tell the library what sort of numbering system you want to use. We’re using the now-standard BCM system. The next line tells the GPIO pins that you want to use Pin 4 as an output. The setup <code>method</code> takes two values: the pin number and a number that tells the library to make that pin an output. This is conveniently hidden by the library, by using a predefined constant that’s defined in the library — that’s why it’s prefixed with <code>io</code>.\r\n\r\nNext, the loop forever of Scratch is carried out in Python with the use of the <code>while True</code> statement, with all statements in this loop indented.\r\n\r\nThis loop then commands the GPIO Pin 4 to be a 0, turning the LED off. Then there’s a delay (or sleep) for 300mS, followed by turning the LED on by making Pin 4 go high. Finally, there’s another delay, so you can see the LED in the On state. A common mistake is to leave out this last delay; as a result, the LED looks to be off all the time. So, controlling a GPIO output is very simple.\r\n\r\nNow, on to the second example of a switch-controlled blink speed. This is shown below, so open up a new file and type it in.\r\n\r\n<code>#!/usr/bin/python3</code>\r\n\r\n \r\n\r\n<code>io.setmode(io.BCM)</code>\r\n\r\n<code>io.setup(4,io.OUT) # make pin into an output</code>\r\n\r\n<code>io.setup(24,io.IN, pull_up_down=io.PUD_UP) # make pin an input</code>\r\n\r\n \r\n\r\n<code>print(\"LED blinker - By Mike Cook\")</code>\r\n\r\n<code>print(\"Ctrl C to quit\")</code>\r\n\r\n<code>while True:</code>\r\n\r\n<code>io.output(4,0)</code>\r\n\r\n<code>if io.input(24) == 1:</code>\r\n\r\n<code>time.sleep(0.30)</code>\r\n\r\n<code>else :</code>\r\n\r\n<code>time.sleep(1.00)</code>\r\n\r\n<code>io.output(4,1)</code>\r\n\r\n<code>if io.input(24) == 1:</code>\r\n\r\n<code>time.sleep(0.30)</code>\r\n\r\n<code>else :</code>\r\n\r\n<code>time.sleep(1.00)</code>\r\n\r\nThis code has the same commands for the output pin, but the input pin setup is new. This command has three parameters: the number of the pin to use, a number in the form of a constant defined by the library, specifying that this pin should function as an input, and, finally, some commands telling the computer to activate the internal pull-up resistor (although, to our ears, <code>PUD_UP</code> sounds more like a mother calling children to tell them their pudding is being served).\r\n\r\nThe LED is first turned off as before, and then the input from the push button is read by the <code>input(24)</code> method, which returns a value of 0 or 1, depending on whether the pin is connected to the ground. This returned value is then compared to 1, and if it’s equal, a 300mS delay is made; otherwise, it produces a 1-second delay. The LED is turned on, and the Conditional Delay code is repeated.","description":"You can access GPIO pins on your Raspberry Pi with Python. Unlike Scratch's graphic-based program blocks, Python uses entirely text-based instructions. Its great power is that the basic Python language can be extended to do more things by the use of <em>libraries.</em> These are functions that can be written in Python or any other language to extend what Python can do.\r\n\r\nWhen using Python to access the GPIO pins, you have a number of different libraries you could choose that can give you access to them. They can provide not only normal input/output access but also access to some of the special functions or capabilities of certain pins.\r\n<p class=\"article-tips remember\">In the early days of the Raspberry Pi, the only access to the GPIO pins was if you were running in Supervisor, or Root, mode. Fortunately, this has now been changed so that you can run in normal User mode with most libraries.</p>\r\nWhile the newly introduced Thonny Python IDE (<em>I</em>ntegrated <em>D</em>evelopment <em>E</em>nvironment) is popular with beginners, our preferred environment for writing Python is IDLE3 (it has more features), but either can be used. IDLE3 and Thonny can both be accessed from the main Desktop Raspberry menu. So, pick the one of your choice and create a new file, and then type in the program you see below. Remember that, in Python, the case of a word matters as does the spaces at the start of a line, so be sure to get them right; otherwise, you will get errors when trying to run your code.\r\n\r\n<code>#!/usr/bin/python3</code>\r\n\r\n<code>import time</code>\r\n\r\n<code>import RPi.GPIO as io # using RPi.GPIO</code>\r\n\r\n \r\n\r\n<code>io.setmode(io.BCM)</code>\r\n\r\n<code>io.setup(4,io.OUT) # make pin into an output</code>\r\n\r\n \r\n\r\n<code>print(\"LED blinker - By Mike Cook\")</code>\r\n\r\n<code>print(\"Ctrl C to quit\")</code>\r\n\r\n<code>while True:</code>\r\n\r\n<code>io.output(4,0)</code>\r\n\r\n<code>time.sleep(0.30)</code>\r\n\r\n<code>io.output(4,1)</code>\r\n\r\n<code>time.sleep(0.30)</code>\r\n\r\nSave the file and run it. Your LED blinks just like the Scratch example.\r\n\r\nTake a look at the code line by line. The program starts by importing the support packages you need. In this case, it’s the time package used to achieve a Delay, or Wait, function, and the RPi.GPIO package to access the GPIO pins. Note here that a lot of examples use <code>as GPIO</code> in the <code>import</code> statement — but you can use the simpler and shorter <code>as io</code> because it reduces the amount of typing and you don't have to keep switching to uppercase.\r\n\r\nThen you have to tell the library what sort of numbering system you want to use. We’re using the now-standard BCM system. The next line tells the GPIO pins that you want to use Pin 4 as an output. The setup <code>method</code> takes two values: the pin number and a number that tells the library to make that pin an output. This is conveniently hidden by the library, by using a predefined constant that’s defined in the library — that’s why it’s prefixed with <code>io</code>.\r\n\r\nNext, the loop forever of Scratch is carried out in Python with the use of the <code>while True</code> statement, with all statements in this loop indented.\r\n\r\nThis loop then commands the GPIO Pin 4 to be a 0, turning the LED off. Then there’s a delay (or sleep) for 300mS, followed by turning the LED on by making Pin 4 go high. Finally, there’s another delay, so you can see the LED in the On state. A common mistake is to leave out this last delay; as a result, the LED looks to be off all the time. So, controlling a GPIO output is very simple.\r\n\r\nNow, on to the second example of a switch-controlled blink speed. This is shown below, so open up a new file and type it in.\r\n\r\n<code>#!/usr/bin/python3</code>\r\n\r\n \r\n\r\n<code>io.setmode(io.BCM)</code>\r\n\r\n<code>io.setup(4,io.OUT) # make pin into an output</code>\r\n\r\n<code>io.setup(24,io.IN, pull_up_down=io.PUD_UP) # make pin an input</code>\r\n\r\n \r\n\r\n<code>print(\"LED blinker - By Mike Cook\")</code>\r\n\r\n<code>print(\"Ctrl C to quit\")</code>\r\n\r\n<code>while True:</code>\r\n\r\n<code>io.output(4,0)</code>\r\n\r\n<code>if io.input(24) == 1:</code>\r\n\r\n<code>time.sleep(0.30)</code>\r\n\r\n<code>else :</code>\r\n\r\n<code>time.sleep(1.00)</code>\r\n\r\n<code>io.output(4,1)</code>\r\n\r\n<code>if io.input(24) == 1:</code>\r\n\r\n<code>time.sleep(0.30)</code>\r\n\r\n<code>else :</code>\r\n\r\n<code>time.sleep(1.00)</code>\r\n\r\nThis code has the same commands for the output pin, but the input pin setup is new. This command has three parameters: the number of the pin to use, a number in the form of a constant defined by the library, specifying that this pin should function as an input, and, finally, some commands telling the computer to activate the internal pull-up resistor (although, to our ears, <code>PUD_UP</code> sounds more like a mother calling children to tell them their pudding is being served).\r\n\r\nThe LED is first turned off as before, and then the input from the push button is read by the <code>input(24)</code> method, which returns a value of 0 or 1, depending on whether the pin is connected to the ground. This returned value is then compared to 1, and if it’s equal, a 300mS delay is made; otherwise, it produces a 1-second delay. The LED is turned on, and the Conditional Delay code is repeated.","blurb":"","authors":[{"authorId":9304,"name":"Sean McManus","slug":"sean-mcmanus","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9304"}},{"authorId":9222,"name":"Mike Cook","slug":"mike-cook","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9222"}}],"primaryCategoryTaxonomy":{"categoryId":33519,"title":"Raspberry Pi","slug":"raspberry-pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":[{"articleId":192609,"title":"How to Pray the Rosary: A Comprehensive Guide","slug":"how-to-pray-the-rosary","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/192609"}},{"articleId":208741,"title":"Kabbalah For Dummies Cheat Sheet","slug":"kabbalah-for-dummies-cheat-sheet","categoryList":["body-mind-spirit","religion-spirituality","kabbalah"],"_links":{"self":"/articles/208741"}},{"articleId":230957,"title":"Nikon D3400 For Dummies Cheat Sheet","slug":"nikon-d3400-dummies-cheat-sheet","categoryList":["home-auto-hobbies","photography"],"_links":{"self":"/articles/230957"}},{"articleId":235851,"title":"Praying the Rosary and Meditating on the Mysteries","slug":"praying-rosary-meditating-mysteries","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/235851"}},{"articleId":284787,"title":"What Your Society Says About You","slug":"what-your-society-says-about-you","categoryList":["academics-the-arts","humanities"],"_links":{"self":"/articles/284787"}}],"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":246452,"title":"How to Set Up the Media Center on Your Raspberry Pi","slug":"set-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246452"}},{"articleId":246448,"title":"Navigating the Media Center on Your Raspberry Pi","slug":"navigating-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246448"}},{"articleId":246445,"title":"How to Change the Settings on Your Raspberry Pi","slug":"change-settings-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246445"}},{"articleId":246442,"title":"How to Use Music Samples on Your Raspberry Pi","slug":"use-music-samples-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246442"}},{"articleId":246436,"title":"How to Use GPIO ZERO on Your Raspberry Pi","slug":"use-gpio-zero-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246436"}}],"fromCategory":[{"articleId":246452,"title":"How to Set Up the Media Center on Your Raspberry Pi","slug":"set-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246452"}},{"articleId":246448,"title":"Navigating the Media Center on Your Raspberry Pi","slug":"navigating-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246448"}},{"articleId":246445,"title":"How to Change the Settings on Your Raspberry Pi","slug":"change-settings-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246445"}},{"articleId":246442,"title":"How to Use Music Samples on Your Raspberry Pi","slug":"use-music-samples-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246442"}},{"articleId":246436,"title":"How to Use GPIO ZERO on Your Raspberry Pi","slug":"use-gpio-zero-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246436"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281848,"slug":"raspberry-pi-for-dummies","isbn":"9781119796824","categoryList":["technology","computers","hardware","raspberry-pi"],"amazon":{"default":"https://www.amazon.com/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119796822-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/raspberry-pi-for-dummies-4e-cover-9781119796824-203x255.jpg","width":203,"height":255},"title":"Raspberry Pi For Dummies","testBankPinActivationLink":"","bookOutOfPrint":true,"authorsInfo":"<p><b><b data-author-id=\"9304\">Sean McManus</b> </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p> <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b><b data-author-id=\"9222\">Mike Cook</b> </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","authors":[{"authorId":9304,"name":"Sean McManus","slug":"sean-mcmanus","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9304"}},{"authorId":9222,"name":"Mike Cook","slug":"mike-cook","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9222"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;computers&quot;,&quot;hardware&quot;,&quot;raspberry-pi&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119796824&quot;]}]\" id=\"du-slot-63221a5e28943\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;computers&quot;,&quot;hardware&quot;,&quot;raspberry-pi&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119796824&quot;]}]\" id=\"du-slot-63221a5e2939d\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":null,"lifeExpectancySetFrom":null,"dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":246439},{"headers":{"creationTime":"2017-11-08T12:00:14+00:00","modifiedTime":"2017-11-08T12:00:14+00:00","timestamp":"2022-09-14T18:15:58+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Computers","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33513"},"slug":"computers","categoryId":33513},{"name":"Hardware","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33516"},"slug":"hardware","categoryId":33516},{"name":"Raspberry Pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"},"slug":"raspberry-pi","categoryId":33519}],"title":"How to Use GPIO ZERO on Your Raspberry Pi","strippedTitle":"how to use gpio zero on your raspberry pi","slug":"use-gpio-zero-raspberry-pi","canonicalUrl":"","seo":{"metaDescription":"There’s a new kid on the block when it comes to accessing the GPIO pins in Python on your Raspberry Pi: the GPIO Zero library. Don't confuse this with the Pi Ze","noIndex":0,"noFollow":0},"content":"There’s a new kid on the block when it comes to accessing the GPIO pins in Python on your Raspberry Pi: the GPIO Zero library. Don't confuse this with the Pi Zero — the two are not related. The GPIO Zero library takes the class method approach to control, as opposed to the function method approach of RPi.GPIO and other, similar libraries. Pins become Python objects, which must be set up before use. Despite this complication, using this system is easy. For example, for an LED blink example, you can use this code\r\n\r\n<code>#!/usr/bin/python3</code>\r\n\r\n<code>import time, os</code>\r\n\r\n<code>import gpiozero as io # using LED zero</code>\r\n\r\n \r\n\r\n<code>led = io.LED(4) # make pin 4 into an output</code>\r\n\r\n \r\n\r\n<code>print(\"LED blinker using gpiozero - By Mike Cook\")</code>\r\n\r\n<code>print(\"Ctrl C to quit\")</code>\r\n\r\n<code>while True:</code>\r\n\r\n<code>led.on()</code>\r\n\r\n<code>time.sleep(0.30)</code>\r\n\r\n<code>led.off()</code>\r\n\r\n<code>time.sleep(0.30)</code>\r\n\r\nThe library uses only the BCM method of pin numbering, so there’s no need to tell the library what system to use. An output pin is known as an <em>LED,</em> irrespective of whether that pin controls an LED, a motor, or a chip. So, the line that makes the pin an output is <code>io.LED(4)</code>. This code segment returns a reference to the class object. Classes and objects are a way to get the same piece of code to handle different specific objects — in this particular case, different GPIO pins.\r\n\r\nIn order to know what it has to do, each thing/pin must be declared separately, and when it is, the program gets a code number to use to identify which specific thing it has to handle. That code number is placed into a variable called <code>led</code> in code above, but could be called anything. (This variable is known as the <em>instance reference.</em>) The class has methods associated with it — things it can do, in other words — and these are called up by writing the instance reference variable name, followed by a period or dot, followed by the method name.\r\n\r\nSo, turning an LED on or off is a simple process — you just write <code>led.on()</code> or <code>led.off()</code>. However, in a way, this is a bit limiting. For example, you cannot send a number in a variable that’s used to turn the LED on or off — it has to be specifically spelt out as a method name. This is a limitation of how GPIO Zero is written, not a limitation of using classes. There are ways round this, but at this point, the simple system gets rather complex.\r\n\r\nIn fact, the code above is written in a way that it looks a lot like the earlier listings. The same thing could simply be written as shown.\r\n\r\n<code>import gpiozeroled = LED(4)</code>\r\n\r\n<code>led.blink()</code>\r\n\r\nAnd that’s all you need. That last statement can have some parameters in it to control the blink rate — so, for example, to exactly match our other examples that last line could be:\r\n\r\n<code>led.blink(on_time = 0.3, off_time = 0.3)</code>\r\n\r\nThis library has even more tricks up its sleeve. If you want to fade that LED up and down instead of just blinking, that last line could say\r\n\r\n<code>led.blink(on_time = 2.0, off_time = 2.0, fade_in_time = 1.0, fade_out_time = 1.0 )</code>\r\n\r\nThis is great if you only want to do that, and for a very young beginner, that’s exactly what you want to do.\r\n\r\nThe blinking speed controlled by a push button can be written like this.\r\n\r\n<code>#!/usr/bin/python3</code>\r\n\r\n<code>import time, os</code>\r\n\r\n<code>import gpiozero as io # using GPIO Zero</code>\r\n\r\n \r\n\r\n<code>led = io.LED(4) # make pin 4 into an output</code>\r\n\r\n<code>push = io.Button(24) # make pin 24 into an input</code>\r\n\r\n \r\n\r\n<code>print(\"LED blinker switch using gpiozero - By Mike Cook\")</code>\r\n\r\n<code>print(\"Ctrl C to quit\")</code>\r\n\r\n<code>while True:</code>\r\n\r\n<code>led.on()</code>\r\n\r\n<code>if push.is_pressed:</code>\r\n\r\n<code>time.sleep(0.30)</code>\r\n\r\n<code>else :</code>\r\n\r\n<code>time.sleep(1.00)</code>\r\n\r\n<code>led.off()</code>\r\n\r\n<code>if push.is_pressed:</code>\r\n\r\n<code>time.sleep(0.30)</code>\r\n\r\n<code>else :</code>\r\n\r\n<code>time.sleep(1.00)</code>\r\n\r\nThe input works in a similar way to the output. In this case, you make an instance of the Button class and put its reference in the variable <code>push</code>. Then you use the <code>is_pressed</code> method of this class to determine the time delay in the blinking. By default, the input pull-up resistor is enabled when you create the class reference.\r\n\r\nThere are other options contained in this input class. It can specify whether a press is to be auto-repeated or specify a <em>debounce time</em> — the time after a change to ignore further changes. As well as the <code>is.pressed</code> method, other class methods include <code>is_held</code>, <code>wait_for_press</code>, <code>wait_for_release</code>, <code>is_held</code>, <code>when_held</code>, <code>when_pressed</code>, and <code>when_released</code>.\r\n\r\nRather than return any information about the input, these last two cause a function to run when the button is pressed or released. This other function runs in a separate thread — in effect, another separate program — with this thread and the main code being swapped in and out alternately until the function is complete. This gives a beginner access to complex concepts that they need to understand only when something goes wrong. So, our controlled blink-rate program could be written as shown.\r\n\r\n<code>#!/usr/bin/python3</code>\r\n\r\n<code>import gpiozero as io # using LED zero</code>\r\n\r\n<code>from signal import pause</code>\r\n\r\n<code>led = io.LED(4) # make pin 4 into an output</code>\r\n\r\n<code>push = io.Button(24) # make pin 24 into an input</code>\r\n\r\n \r\n\r\n<code>def blinkFast():</code>\r\n\r\n<code>led.blink(on_time = 0.3, off_time = 0.3)</code>\r\n\r\n \r\n\r\n<code>def blinkSlow():</code>\r\n\r\n<code>led.blink(on_time = 1.0, off_time = 1.0)</code>\r\n\r\n \r\n\r\n<code>push.when_pressed = blinkFast</code>\r\n\r\n<code>push.when_released = blinkSlow</code>\r\n\r\n \r\n\r\n<code>pause()</code>\r\n\r\nThe <code>pause</code> function, in effect, ends the program, and the only thing that happens is when the callback functions, as they are called, are invoked or triggered on the push or release of the button.\r\n<p class=\"article-tips remember\">A lot of the programming work involved in using GIPO Zero involves leafing through the documentation to see what simple functions the authors have implemented for you. GPIO Zero enables you to get results quickly, and without needing to understand much of what is going on — which is helpful if a function does what you need. However, although some things can be done simply, the skills learned are not exactly transferable. As you develop more complex electronic projects, you might find GPIO Zero to be too limited for your needs.</p>","description":"There’s a new kid on the block when it comes to accessing the GPIO pins in Python on your Raspberry Pi: the GPIO Zero library. Don't confuse this with the Pi Zero — the two are not related. The GPIO Zero library takes the class method approach to control, as opposed to the function method approach of RPi.GPIO and other, similar libraries. Pins become Python objects, which must be set up before use. Despite this complication, using this system is easy. For example, for an LED blink example, you can use this code\r\n\r\n<code>#!/usr/bin/python3</code>\r\n\r\n<code>import time, os</code>\r\n\r\n<code>import gpiozero as io # using LED zero</code>\r\n\r\n \r\n\r\n<code>led = io.LED(4) # make pin 4 into an output</code>\r\n\r\n \r\n\r\n<code>print(\"LED blinker using gpiozero - By Mike Cook\")</code>\r\n\r\n<code>print(\"Ctrl C to quit\")</code>\r\n\r\n<code>while True:</code>\r\n\r\n<code>led.on()</code>\r\n\r\n<code>time.sleep(0.30)</code>\r\n\r\n<code>led.off()</code>\r\n\r\n<code>time.sleep(0.30)</code>\r\n\r\nThe library uses only the BCM method of pin numbering, so there’s no need to tell the library what system to use. An output pin is known as an <em>LED,</em> irrespective of whether that pin controls an LED, a motor, or a chip. So, the line that makes the pin an output is <code>io.LED(4)</code>. This code segment returns a reference to the class object. Classes and objects are a way to get the same piece of code to handle different specific objects — in this particular case, different GPIO pins.\r\n\r\nIn order to know what it has to do, each thing/pin must be declared separately, and when it is, the program gets a code number to use to identify which specific thing it has to handle. That code number is placed into a variable called <code>led</code> in code above, but could be called anything. (This variable is known as the <em>instance reference.</em>) The class has methods associated with it — things it can do, in other words — and these are called up by writing the instance reference variable name, followed by a period or dot, followed by the method name.\r\n\r\nSo, turning an LED on or off is a simple process — you just write <code>led.on()</code> or <code>led.off()</code>. However, in a way, this is a bit limiting. For example, you cannot send a number in a variable that’s used to turn the LED on or off — it has to be specifically spelt out as a method name. This is a limitation of how GPIO Zero is written, not a limitation of using classes. There are ways round this, but at this point, the simple system gets rather complex.\r\n\r\nIn fact, the code above is written in a way that it looks a lot like the earlier listings. The same thing could simply be written as shown.\r\n\r\n<code>import gpiozeroled = LED(4)</code>\r\n\r\n<code>led.blink()</code>\r\n\r\nAnd that’s all you need. That last statement can have some parameters in it to control the blink rate — so, for example, to exactly match our other examples that last line could be:\r\n\r\n<code>led.blink(on_time = 0.3, off_time = 0.3)</code>\r\n\r\nThis library has even more tricks up its sleeve. If you want to fade that LED up and down instead of just blinking, that last line could say\r\n\r\n<code>led.blink(on_time = 2.0, off_time = 2.0, fade_in_time = 1.0, fade_out_time = 1.0 )</code>\r\n\r\nThis is great if you only want to do that, and for a very young beginner, that’s exactly what you want to do.\r\n\r\nThe blinking speed controlled by a push button can be written like this.\r\n\r\n<code>#!/usr/bin/python3</code>\r\n\r\n<code>import time, os</code>\r\n\r\n<code>import gpiozero as io # using GPIO Zero</code>\r\n\r\n \r\n\r\n<code>led = io.LED(4) # make pin 4 into an output</code>\r\n\r\n<code>push = io.Button(24) # make pin 24 into an input</code>\r\n\r\n \r\n\r\n<code>print(\"LED blinker switch using gpiozero - By Mike Cook\")</code>\r\n\r\n<code>print(\"Ctrl C to quit\")</code>\r\n\r\n<code>while True:</code>\r\n\r\n<code>led.on()</code>\r\n\r\n<code>if push.is_pressed:</code>\r\n\r\n<code>time.sleep(0.30)</code>\r\n\r\n<code>else :</code>\r\n\r\n<code>time.sleep(1.00)</code>\r\n\r\n<code>led.off()</code>\r\n\r\n<code>if push.is_pressed:</code>\r\n\r\n<code>time.sleep(0.30)</code>\r\n\r\n<code>else :</code>\r\n\r\n<code>time.sleep(1.00)</code>\r\n\r\nThe input works in a similar way to the output. In this case, you make an instance of the Button class and put its reference in the variable <code>push</code>. Then you use the <code>is_pressed</code> method of this class to determine the time delay in the blinking. By default, the input pull-up resistor is enabled when you create the class reference.\r\n\r\nThere are other options contained in this input class. It can specify whether a press is to be auto-repeated or specify a <em>debounce time</em> — the time after a change to ignore further changes. As well as the <code>is.pressed</code> method, other class methods include <code>is_held</code>, <code>wait_for_press</code>, <code>wait_for_release</code>, <code>is_held</code>, <code>when_held</code>, <code>when_pressed</code>, and <code>when_released</code>.\r\n\r\nRather than return any information about the input, these last two cause a function to run when the button is pressed or released. This other function runs in a separate thread — in effect, another separate program — with this thread and the main code being swapped in and out alternately until the function is complete. This gives a beginner access to complex concepts that they need to understand only when something goes wrong. So, our controlled blink-rate program could be written as shown.\r\n\r\n<code>#!/usr/bin/python3</code>\r\n\r\n<code>import gpiozero as io # using LED zero</code>\r\n\r\n<code>from signal import pause</code>\r\n\r\n<code>led = io.LED(4) # make pin 4 into an output</code>\r\n\r\n<code>push = io.Button(24) # make pin 24 into an input</code>\r\n\r\n \r\n\r\n<code>def blinkFast():</code>\r\n\r\n<code>led.blink(on_time = 0.3, off_time = 0.3)</code>\r\n\r\n \r\n\r\n<code>def blinkSlow():</code>\r\n\r\n<code>led.blink(on_time = 1.0, off_time = 1.0)</code>\r\n\r\n \r\n\r\n<code>push.when_pressed = blinkFast</code>\r\n\r\n<code>push.when_released = blinkSlow</code>\r\n\r\n \r\n\r\n<code>pause()</code>\r\n\r\nThe <code>pause</code> function, in effect, ends the program, and the only thing that happens is when the callback functions, as they are called, are invoked or triggered on the push or release of the button.\r\n<p class=\"article-tips remember\">A lot of the programming work involved in using GIPO Zero involves leafing through the documentation to see what simple functions the authors have implemented for you. GPIO Zero enables you to get results quickly, and without needing to understand much of what is going on — which is helpful if a function does what you need. However, although some things can be done simply, the skills learned are not exactly transferable. As you develop more complex electronic projects, you might find GPIO Zero to be too limited for your needs.</p>","blurb":"","authors":[{"authorId":9304,"name":"Sean McManus","slug":"sean-mcmanus","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9304"}},{"authorId":9222,"name":"Mike Cook","slug":"mike-cook","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9222"}}],"primaryCategoryTaxonomy":{"categoryId":33519,"title":"Raspberry Pi","slug":"raspberry-pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":[{"articleId":192609,"title":"How to Pray the Rosary: A Comprehensive Guide","slug":"how-to-pray-the-rosary","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/192609"}},{"articleId":208741,"title":"Kabbalah For Dummies Cheat Sheet","slug":"kabbalah-for-dummies-cheat-sheet","categoryList":["body-mind-spirit","religion-spirituality","kabbalah"],"_links":{"self":"/articles/208741"}},{"articleId":230957,"title":"Nikon D3400 For Dummies Cheat Sheet","slug":"nikon-d3400-dummies-cheat-sheet","categoryList":["home-auto-hobbies","photography"],"_links":{"self":"/articles/230957"}},{"articleId":235851,"title":"Praying the Rosary and Meditating on the Mysteries","slug":"praying-rosary-meditating-mysteries","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/235851"}},{"articleId":284787,"title":"What Your Society Says About You","slug":"what-your-society-says-about-you","categoryList":["academics-the-arts","humanities"],"_links":{"self":"/articles/284787"}}],"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":246452,"title":"How to Set Up the Media Center on Your Raspberry Pi","slug":"set-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246452"}},{"articleId":246448,"title":"Navigating the Media Center on Your Raspberry Pi","slug":"navigating-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246448"}},{"articleId":246445,"title":"How to Change the Settings on Your Raspberry Pi","slug":"change-settings-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246445"}},{"articleId":246442,"title":"How to Use Music Samples on Your Raspberry Pi","slug":"use-music-samples-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246442"}},{"articleId":246439,"title":"How to Use Python to Access GPIO Pins on Your Raspberry Pi","slug":"use-python-access-gpio-pins-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246439"}}],"fromCategory":[{"articleId":246452,"title":"How to Set Up the Media Center on Your Raspberry Pi","slug":"set-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246452"}},{"articleId":246448,"title":"Navigating the Media Center on Your Raspberry Pi","slug":"navigating-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246448"}},{"articleId":246445,"title":"How to Change the Settings on Your Raspberry Pi","slug":"change-settings-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246445"}},{"articleId":246442,"title":"How to Use Music Samples on Your Raspberry Pi","slug":"use-music-samples-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246442"}},{"articleId":246439,"title":"How to Use Python to Access GPIO Pins on Your Raspberry Pi","slug":"use-python-access-gpio-pins-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246439"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281848,"slug":"raspberry-pi-for-dummies","isbn":"9781119796824","categoryList":["technology","computers","hardware","raspberry-pi"],"amazon":{"default":"https://www.amazon.com/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119796822-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/raspberry-pi-for-dummies-4e-cover-9781119796824-203x255.jpg","width":203,"height":255},"title":"Raspberry Pi For Dummies","testBankPinActivationLink":"","bookOutOfPrint":true,"authorsInfo":"<p><b><b data-author-id=\"9304\">Sean McManus</b> </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p> <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b><b data-author-id=\"9222\">Mike Cook</b> </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","authors":[{"authorId":9304,"name":"Sean McManus","slug":"sean-mcmanus","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9304"}},{"authorId":9222,"name":"Mike Cook","slug":"mike-cook","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9222"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;computers&quot;,&quot;hardware&quot;,&quot;raspberry-pi&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119796824&quot;]}]\" id=\"du-slot-63221a5e214af\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;computers&quot;,&quot;hardware&quot;,&quot;raspberry-pi&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119796824&quot;]}]\" id=\"du-slot-63221a5e21d16\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":null,"lifeExpectancySetFrom":null,"dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":246436},{"headers":{"creationTime":"2017-11-07T12:57:44+00:00","modifiedTime":"2017-11-07T12:57:44+00:00","timestamp":"2022-09-14T18:15:57+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Computers","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33513"},"slug":"computers","categoryId":33513},{"name":"Hardware","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33516"},"slug":"hardware","categoryId":33516},{"name":"Raspberry Pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"},"slug":"raspberry-pi","categoryId":33519}],"title":"How to Use Note and Chord Names to Make Music on Your Raspberry Pi","strippedTitle":"how to use note and chord names to make music on your raspberry pi","slug":"use-note-chord-names-make-music-raspberry-pi","canonicalUrl":"","seo":{"metaDescription":"Sonic Pi enables you to use proper note names instead of MIDI numbers to play music on the RaspberryPi by using the name of the note (a letter from A to G), plu","noIndex":0,"noFollow":0},"content":"Sonic Pi enables you to use proper note names instead of MIDI numbers to play music on the RaspberryPi by using the name of the note (a letter from A to G), plus the number of the octave it’s in.\r\n\r\nFor example, to play a middle C, you can use\r\n\r\n<code>play :c4</code>\r\n\r\nTo play the B one note before it, which is in the next lowest octave, you would use\r\n\r\n<code>play :b3</code>\r\n\r\nThe Log shows that Sonic Pi plays notes 60 and 59 respectively. You can check the note names and numbers to confirm that this is what you expected.\r\n<table width=\"605\"><caption>MIDI Notes</caption>\r\n<thead>\r\n<tr>\r\n<td width=\"66\">Note</td>\r\n<td width=\"66\"></td>\r\n<td width=\"57\">0</td>\r\n<td width=\"28\">1</td>\r\n<td width=\"38\">2</td>\r\n<td width=\"38\">3</td>\r\n<td width=\"47\">4</td>\r\n<td width=\"47\">5</td>\r\n<td width=\"47\">6</td>\r\n<td width=\"47\">7</td>\r\n<td width=\"57\">8</td>\r\n<td width=\"66\">9</td>\r\n</tr>\r\n</thead>\r\n<tbody>\r\n<tr>\r\n<td width=\"66\">C</td>\r\n<td width=\"66\">0</td>\r\n<td width=\"57\">12</td>\r\n<td width=\"28\">24</td>\r\n<td width=\"38\">36</td>\r\n<td width=\"38\">48</td>\r\n<td width=\"47\">60</td>\r\n<td width=\"47\">72</td>\r\n<td width=\"47\">84</td>\r\n<td width=\"47\">96</td>\r\n<td width=\"57\">108</td>\r\n<td width=\"66\">120</td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">C#</td>\r\n<td width=\"66\">1</td>\r\n<td width=\"57\">13</td>\r\n<td width=\"28\">25</td>\r\n<td width=\"38\">37</td>\r\n<td width=\"38\">49</td>\r\n<td width=\"47\">61</td>\r\n<td width=\"47\">73</td>\r\n<td width=\"47\">85</td>\r\n<td width=\"47\">97</td>\r\n<td width=\"57\">109</td>\r\n<td width=\"66\">121</td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">D</td>\r\n<td width=\"66\">2</td>\r\n<td width=\"57\">14</td>\r\n<td width=\"28\">26</td>\r\n<td width=\"38\">38</td>\r\n<td width=\"38\">50</td>\r\n<td width=\"47\">62</td>\r\n<td width=\"47\">74</td>\r\n<td width=\"47\">86</td>\r\n<td width=\"47\">98</td>\r\n<td width=\"57\">110</td>\r\n<td width=\"66\">122</td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">D#</td>\r\n<td width=\"66\">3</td>\r\n<td width=\"57\">15</td>\r\n<td width=\"28\">27</td>\r\n<td width=\"38\">39</td>\r\n<td width=\"38\">51</td>\r\n<td width=\"47\">63</td>\r\n<td width=\"47\">75</td>\r\n<td width=\"47\">87</td>\r\n<td width=\"47\">99</td>\r\n<td width=\"57\">111</td>\r\n<td width=\"66\">123</td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">E</td>\r\n<td width=\"66\">4</td>\r\n<td width=\"57\">16</td>\r\n<td width=\"28\">28</td>\r\n<td width=\"38\">40</td>\r\n<td width=\"38\">52</td>\r\n<td width=\"47\">64</td>\r\n<td width=\"47\">76</td>\r\n<td width=\"47\">88</td>\r\n<td width=\"47\">100</td>\r\n<td width=\"57\">112</td>\r\n<td width=\"66\">124</td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">F</td>\r\n<td width=\"66\">5</td>\r\n<td width=\"57\">17</td>\r\n<td width=\"28\">29</td>\r\n<td width=\"38\">41</td>\r\n<td width=\"38\">53</td>\r\n<td width=\"47\">65</td>\r\n<td width=\"47\">77</td>\r\n<td width=\"47\">89</td>\r\n<td width=\"47\">101</td>\r\n<td width=\"57\">113</td>\r\n<td width=\"66\">125</td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">F#</td>\r\n<td width=\"66\">6</td>\r\n<td width=\"57\">18</td>\r\n<td width=\"28\">30</td>\r\n<td width=\"38\">42</td>\r\n<td width=\"38\">54</td>\r\n<td width=\"47\">66</td>\r\n<td width=\"47\">78</td>\r\n<td width=\"47\">90</td>\r\n<td width=\"47\">102</td>\r\n<td width=\"57\">114</td>\r\n<td width=\"66\">126</td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">G</td>\r\n<td width=\"66\">7</td>\r\n<td width=\"57\">19</td>\r\n<td width=\"28\">31</td>\r\n<td width=\"38\">43</td>\r\n<td width=\"38\">55</td>\r\n<td width=\"47\">67</td>\r\n<td width=\"47\">79</td>\r\n<td width=\"47\">91</td>\r\n<td width=\"47\">103</td>\r\n<td width=\"57\">115</td>\r\n<td width=\"66\">127</td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">G#</td>\r\n<td width=\"66\">8</td>\r\n<td width=\"57\">20</td>\r\n<td width=\"28\">32</td>\r\n<td width=\"38\">44</td>\r\n<td width=\"38\">56</td>\r\n<td width=\"47\">68</td>\r\n<td width=\"47\">80</td>\r\n<td width=\"47\">92</td>\r\n<td width=\"47\">104</td>\r\n<td width=\"57\">116</td>\r\n<td width=\"66\"></td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">A</td>\r\n<td width=\"66\">9</td>\r\n<td width=\"57\">21</td>\r\n<td width=\"28\">33</td>\r\n<td width=\"38\">45</td>\r\n<td width=\"38\">57</td>\r\n<td width=\"47\">69</td>\r\n<td width=\"47\">81</td>\r\n<td width=\"47\">93</td>\r\n<td width=\"47\">105</td>\r\n<td width=\"57\">117</td>\r\n<td width=\"66\"></td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">A#</td>\r\n<td width=\"66\">10</td>\r\n<td width=\"57\">22</td>\r\n<td width=\"28\">34</td>\r\n<td width=\"38\">46</td>\r\n<td width=\"38\">58</td>\r\n<td width=\"47\">70</td>\r\n<td width=\"47\">82</td>\r\n<td width=\"47\">94</td>\r\n<td width=\"47\">106</td>\r\n<td width=\"57\">118</td>\r\n<td width=\"66\"></td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">B</td>\r\n<td width=\"66\">11</td>\r\n<td width=\"57\">23</td>\r\n<td width=\"28\">35</td>\r\n<td width=\"38\">47</td>\r\n<td width=\"38\">59</td>\r\n<td width=\"47\">71</td>\r\n<td width=\"47\">83</td>\r\n<td width=\"47\">95</td>\r\n<td width=\"47\">107</td>\r\n<td width=\"57\">119</td>\r\n<td width=\"66\"></td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n \r\n\r\nHere's how you could code a fanfare using note names instead of numbers:\r\n\r\n<code>play :c4</code>\r\n\r\n<code>sleep 0.5</code>\r\n\r\n<code>play :e4</code>\r\n\r\n<code>sleep 0.5</code>\r\n\r\n<code>play :g4</code>\r\n\r\n<code>sleep 0.5</code>\r\n\r\n<code>play :c5</code>\r\n\r\nIf you want to use a sharp note, insert the letter <em>s</em> in the note name (for example, <code>play :cs4</code>) and use <em>b</em> for a flat note (<code>play :cb4</code>).\r\n\r\nYou can also use names to play chords. You tell Sonic Pi the lowest note in the chord and add which type of chord you want (try <code>:major</code>, <code>:minor</code>, or <code>:diminished</code>). There are also options for <code>:major7</code>, <code>:minor7</code>, <code>:diminished7</code>, and <code>:dom7</code>, among others. For a complete list, click Lang in the Help pane, and then select Chord. Try this:\r\n\r\n<code>play chord(:a3, :major)</code>\r\n\r\n<code>sleep 1</code>\r\n\r\n<code>play chord(:a3, :minor)</code>\r\n\r\nIn each case, it plays three notes at the same time. If you look at the note numbers in the Log, you can see that the middle note was one pitch lower in the second chord because it’s a minor chord. Again, you can use Table 14-1 to check the note numbers Sonic Pi displays against the musical note names.\r\n\r\nThe chord is returned as a list, and you can use <code>play_pattern</code> to hear the notes of the chord in a sequence, like this:\r\n\r\n<code>play_pattern chord(:a3, :major)</code>\r\n\r\n<code>play_pattern chord(:a3, :minor)</code>","description":"Sonic Pi enables you to use proper note names instead of MIDI numbers to play music on the RaspberryPi by using the name of the note (a letter from A to G), plus the number of the octave it’s in.\r\n\r\nFor example, to play a middle C, you can use\r\n\r\n<code>play :c4</code>\r\n\r\nTo play the B one note before it, which is in the next lowest octave, you would use\r\n\r\n<code>play :b3</code>\r\n\r\nThe Log shows that Sonic Pi plays notes 60 and 59 respectively. You can check the note names and numbers to confirm that this is what you expected.\r\n<table width=\"605\"><caption>MIDI Notes</caption>\r\n<thead>\r\n<tr>\r\n<td width=\"66\">Note</td>\r\n<td width=\"66\"></td>\r\n<td width=\"57\">0</td>\r\n<td width=\"28\">1</td>\r\n<td width=\"38\">2</td>\r\n<td width=\"38\">3</td>\r\n<td width=\"47\">4</td>\r\n<td width=\"47\">5</td>\r\n<td width=\"47\">6</td>\r\n<td width=\"47\">7</td>\r\n<td width=\"57\">8</td>\r\n<td width=\"66\">9</td>\r\n</tr>\r\n</thead>\r\n<tbody>\r\n<tr>\r\n<td width=\"66\">C</td>\r\n<td width=\"66\">0</td>\r\n<td width=\"57\">12</td>\r\n<td width=\"28\">24</td>\r\n<td width=\"38\">36</td>\r\n<td width=\"38\">48</td>\r\n<td width=\"47\">60</td>\r\n<td width=\"47\">72</td>\r\n<td width=\"47\">84</td>\r\n<td width=\"47\">96</td>\r\n<td width=\"57\">108</td>\r\n<td width=\"66\">120</td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">C#</td>\r\n<td width=\"66\">1</td>\r\n<td width=\"57\">13</td>\r\n<td width=\"28\">25</td>\r\n<td width=\"38\">37</td>\r\n<td width=\"38\">49</td>\r\n<td width=\"47\">61</td>\r\n<td width=\"47\">73</td>\r\n<td width=\"47\">85</td>\r\n<td width=\"47\">97</td>\r\n<td width=\"57\">109</td>\r\n<td width=\"66\">121</td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">D</td>\r\n<td width=\"66\">2</td>\r\n<td width=\"57\">14</td>\r\n<td width=\"28\">26</td>\r\n<td width=\"38\">38</td>\r\n<td width=\"38\">50</td>\r\n<td width=\"47\">62</td>\r\n<td width=\"47\">74</td>\r\n<td width=\"47\">86</td>\r\n<td width=\"47\">98</td>\r\n<td width=\"57\">110</td>\r\n<td width=\"66\">122</td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">D#</td>\r\n<td width=\"66\">3</td>\r\n<td width=\"57\">15</td>\r\n<td width=\"28\">27</td>\r\n<td width=\"38\">39</td>\r\n<td width=\"38\">51</td>\r\n<td width=\"47\">63</td>\r\n<td width=\"47\">75</td>\r\n<td width=\"47\">87</td>\r\n<td width=\"47\">99</td>\r\n<td width=\"57\">111</td>\r\n<td width=\"66\">123</td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">E</td>\r\n<td width=\"66\">4</td>\r\n<td width=\"57\">16</td>\r\n<td width=\"28\">28</td>\r\n<td width=\"38\">40</td>\r\n<td width=\"38\">52</td>\r\n<td width=\"47\">64</td>\r\n<td width=\"47\">76</td>\r\n<td width=\"47\">88</td>\r\n<td width=\"47\">100</td>\r\n<td width=\"57\">112</td>\r\n<td width=\"66\">124</td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">F</td>\r\n<td width=\"66\">5</td>\r\n<td width=\"57\">17</td>\r\n<td width=\"28\">29</td>\r\n<td width=\"38\">41</td>\r\n<td width=\"38\">53</td>\r\n<td width=\"47\">65</td>\r\n<td width=\"47\">77</td>\r\n<td width=\"47\">89</td>\r\n<td width=\"47\">101</td>\r\n<td width=\"57\">113</td>\r\n<td width=\"66\">125</td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">F#</td>\r\n<td width=\"66\">6</td>\r\n<td width=\"57\">18</td>\r\n<td width=\"28\">30</td>\r\n<td width=\"38\">42</td>\r\n<td width=\"38\">54</td>\r\n<td width=\"47\">66</td>\r\n<td width=\"47\">78</td>\r\n<td width=\"47\">90</td>\r\n<td width=\"47\">102</td>\r\n<td width=\"57\">114</td>\r\n<td width=\"66\">126</td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">G</td>\r\n<td width=\"66\">7</td>\r\n<td width=\"57\">19</td>\r\n<td width=\"28\">31</td>\r\n<td width=\"38\">43</td>\r\n<td width=\"38\">55</td>\r\n<td width=\"47\">67</td>\r\n<td width=\"47\">79</td>\r\n<td width=\"47\">91</td>\r\n<td width=\"47\">103</td>\r\n<td width=\"57\">115</td>\r\n<td width=\"66\">127</td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">G#</td>\r\n<td width=\"66\">8</td>\r\n<td width=\"57\">20</td>\r\n<td width=\"28\">32</td>\r\n<td width=\"38\">44</td>\r\n<td width=\"38\">56</td>\r\n<td width=\"47\">68</td>\r\n<td width=\"47\">80</td>\r\n<td width=\"47\">92</td>\r\n<td width=\"47\">104</td>\r\n<td width=\"57\">116</td>\r\n<td width=\"66\"></td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">A</td>\r\n<td width=\"66\">9</td>\r\n<td width=\"57\">21</td>\r\n<td width=\"28\">33</td>\r\n<td width=\"38\">45</td>\r\n<td width=\"38\">57</td>\r\n<td width=\"47\">69</td>\r\n<td width=\"47\">81</td>\r\n<td width=\"47\">93</td>\r\n<td width=\"47\">105</td>\r\n<td width=\"57\">117</td>\r\n<td width=\"66\"></td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">A#</td>\r\n<td width=\"66\">10</td>\r\n<td width=\"57\">22</td>\r\n<td width=\"28\">34</td>\r\n<td width=\"38\">46</td>\r\n<td width=\"38\">58</td>\r\n<td width=\"47\">70</td>\r\n<td width=\"47\">82</td>\r\n<td width=\"47\">94</td>\r\n<td width=\"47\">106</td>\r\n<td width=\"57\">118</td>\r\n<td width=\"66\"></td>\r\n</tr>\r\n<tr>\r\n<td width=\"66\">B</td>\r\n<td width=\"66\">11</td>\r\n<td width=\"57\">23</td>\r\n<td width=\"28\">35</td>\r\n<td width=\"38\">47</td>\r\n<td width=\"38\">59</td>\r\n<td width=\"47\">71</td>\r\n<td width=\"47\">83</td>\r\n<td width=\"47\">95</td>\r\n<td width=\"47\">107</td>\r\n<td width=\"57\">119</td>\r\n<td width=\"66\"></td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n \r\n\r\nHere's how you could code a fanfare using note names instead of numbers:\r\n\r\n<code>play :c4</code>\r\n\r\n<code>sleep 0.5</code>\r\n\r\n<code>play :e4</code>\r\n\r\n<code>sleep 0.5</code>\r\n\r\n<code>play :g4</code>\r\n\r\n<code>sleep 0.5</code>\r\n\r\n<code>play :c5</code>\r\n\r\nIf you want to use a sharp note, insert the letter <em>s</em> in the note name (for example, <code>play :cs4</code>) and use <em>b</em> for a flat note (<code>play :cb4</code>).\r\n\r\nYou can also use names to play chords. You tell Sonic Pi the lowest note in the chord and add which type of chord you want (try <code>:major</code>, <code>:minor</code>, or <code>:diminished</code>). There are also options for <code>:major7</code>, <code>:minor7</code>, <code>:diminished7</code>, and <code>:dom7</code>, among others. For a complete list, click Lang in the Help pane, and then select Chord. Try this:\r\n\r\n<code>play chord(:a3, :major)</code>\r\n\r\n<code>sleep 1</code>\r\n\r\n<code>play chord(:a3, :minor)</code>\r\n\r\nIn each case, it plays three notes at the same time. If you look at the note numbers in the Log, you can see that the middle note was one pitch lower in the second chord because it’s a minor chord. Again, you can use Table 14-1 to check the note numbers Sonic Pi displays against the musical note names.\r\n\r\nThe chord is returned as a list, and you can use <code>play_pattern</code> to hear the notes of the chord in a sequence, like this:\r\n\r\n<code>play_pattern chord(:a3, :major)</code>\r\n\r\n<code>play_pattern chord(:a3, :minor)</code>","blurb":"","authors":[{"authorId":9304,"name":"Sean McManus","slug":"sean-mcmanus","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9304"}},{"authorId":9222,"name":"Mike Cook","slug":"mike-cook","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9222"}}],"primaryCategoryTaxonomy":{"categoryId":33519,"title":"Raspberry Pi","slug":"raspberry-pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":[{"articleId":192609,"title":"How to Pray the Rosary: A Comprehensive Guide","slug":"how-to-pray-the-rosary","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/192609"}},{"articleId":208741,"title":"Kabbalah For Dummies Cheat Sheet","slug":"kabbalah-for-dummies-cheat-sheet","categoryList":["body-mind-spirit","religion-spirituality","kabbalah"],"_links":{"self":"/articles/208741"}},{"articleId":230957,"title":"Nikon D3400 For Dummies Cheat Sheet","slug":"nikon-d3400-dummies-cheat-sheet","categoryList":["home-auto-hobbies","photography"],"_links":{"self":"/articles/230957"}},{"articleId":235851,"title":"Praying the Rosary and Meditating on the Mysteries","slug":"praying-rosary-meditating-mysteries","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/235851"}},{"articleId":284787,"title":"What Your Society Says About You","slug":"what-your-society-says-about-you","categoryList":["academics-the-arts","humanities"],"_links":{"self":"/articles/284787"}}],"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":246452,"title":"How to Set Up the Media Center on Your Raspberry Pi","slug":"set-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246452"}},{"articleId":246448,"title":"Navigating the Media Center on Your Raspberry Pi","slug":"navigating-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246448"}},{"articleId":246445,"title":"How to Change the Settings on Your Raspberry Pi","slug":"change-settings-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246445"}},{"articleId":246442,"title":"How to Use Music Samples on Your Raspberry Pi","slug":"use-music-samples-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246442"}},{"articleId":246439,"title":"How to Use Python to Access GPIO Pins on Your Raspberry Pi","slug":"use-python-access-gpio-pins-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246439"}}],"fromCategory":[{"articleId":246452,"title":"How to Set Up the Media Center on Your Raspberry Pi","slug":"set-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246452"}},{"articleId":246448,"title":"Navigating the Media Center on Your Raspberry Pi","slug":"navigating-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246448"}},{"articleId":246445,"title":"How to Change the Settings on Your Raspberry Pi","slug":"change-settings-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246445"}},{"articleId":246442,"title":"How to Use Music Samples on Your Raspberry Pi","slug":"use-music-samples-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246442"}},{"articleId":246439,"title":"How to Use Python to Access GPIO Pins on Your Raspberry Pi","slug":"use-python-access-gpio-pins-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246439"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281848,"slug":"raspberry-pi-for-dummies","isbn":"9781119796824","categoryList":["technology","computers","hardware","raspberry-pi"],"amazon":{"default":"https://www.amazon.com/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119796822-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/raspberry-pi-for-dummies-4e-cover-9781119796824-203x255.jpg","width":203,"height":255},"title":"Raspberry Pi For Dummies","testBankPinActivationLink":"","bookOutOfPrint":true,"authorsInfo":"<p><b><b data-author-id=\"9304\">Sean McManus</b> </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p> <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b><b data-author-id=\"9222\">Mike Cook</b> </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","authors":[{"authorId":9304,"name":"Sean McManus","slug":"sean-mcmanus","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9304"}},{"authorId":9222,"name":"Mike Cook","slug":"mike-cook","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9222"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;computers&quot;,&quot;hardware&quot;,&quot;raspberry-pi&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119796824&quot;]}]\" id=\"du-slot-63221a5da8abd\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;computers&quot;,&quot;hardware&quot;,&quot;raspberry-pi&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119796824&quot;]}]\" id=\"du-slot-63221a5da9340\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":null,"lifeExpectancySetFrom":null,"dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":246380},{"headers":{"creationTime":"2017-11-07T12:50:03+00:00","modifiedTime":"2017-11-07T12:50:03+00:00","timestamp":"2022-09-14T18:15:57+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Computers","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33513"},"slug":"computers","categoryId":33513},{"name":"Hardware","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33516"},"slug":"hardware","categoryId":33516},{"name":"Raspberry Pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"},"slug":"raspberry-pi","categoryId":33519}],"title":"How to Make Colors with LEDs on Your Raspberry Pi","strippedTitle":"how to make colors with leds on your raspberry pi","slug":"make-colors-leds-raspberry-pi","canonicalUrl":"","seo":{"metaDescription":"Let’s do some fun stuff with your Raspberry Pi’s LEDs: mixing colors. Yes, you can turn on just one LED at a time, and that will give you one of the three color","noIndex":0,"noFollow":0},"content":"Let’s do some fun stuff with your Raspberry Pi’s LEDs: mixing colors. Yes, you can turn on just one LED at a time, and that will give you one of the three colors — red, blue, or green. However, turn two on and the colors will mix in a way known as <em>additive mixing</em>.\r\n\r\nThe primary colors are red, green, and blue. Mixing them together gives you other colors, the so-called <em>secondary</em> colors. So a red-and-green light together make a yellow one. A green-and-blue light make a cyan color, and a red-and-blue light make magenta. Turn on all three LEDs together and you make white — or, more precisely, they make a white tint.\r\n<p class=\"article-tips tech\">In theory, all three LEDs on together will make white, but in practice this depends on the exact brightness of the three separate lights. They have to be identical to make a pure white; otherwise, the white looks tinted, which is not altogether a bad thing. It's not an easy task to do this, because each color has a different forward voltage drop — you need different resistors to ensure the same current through each LED. Not only that, each color of LED converts current to brightness with a different efficiency, which complicates things tremendously.</p>\r\nYou might be used to mixing colored paint, but keep in mind you get different results doing this than mixing light. Paint mixing is known as <em>subtractive mixing</em> because each paint color you put into the mix takes out (or subtracts) some other color. This is how your color printer works. For subtractive mixing, the primary colors are cyan, magenta, and yellow; red, green, and blue being the secondary colors.\r\n<h2 id=\"tab1\" >Using diffusers</h2>\r\nThe light from three LEDs in the same package will still be seen as three separate points of light, unless there is some sort of diffuser, which allows the light to mix evenly. For individual RGB LEDs, this is sometimes provided by the package or body of the LED itself. Viewing distance alone can provide enough diffusion to mix the colors, but often a diffuser of some sort will help. Diffusers also reduce the brightness per unit area of the LED, making it much easer to take a good color picture.\r\n\r\nYou can use anything that is translucent as a diffuser. Our favorite is a very thin styrene sheet — about 0.5mm thickness is fine and is easy to work with, because it can be cut with scissors. (A good alternative is a simple sheet of paper.) If you have several LEDs and want to see the light from each distinctly, then you have to have each one surrounded by a light baffle — sometimes known loosely as an <em>egg box,</em> or <em>waffle box.</em>\r\n\r\nWithout the baffle, the light from each LED mixes with those adjacent to it and gives a soft focus effect that is not at all unpleasant. The degree of diffusion you get is proportional to not only the diffusing material but also the distance of that material from the LED. In most cases, a few millimeters is fine.\r\n<p class=\"article-tips tip\">You can turn the clear-plastic housing LED into a diffuser by rubbing it gently with very fine sandpaper or wire wool. Even better is to use a foam-backed sanding block, because it gets round the curves much better than paper. These LED housings are made of resin, so solvents like acetone do not affect the surface.</p>\r\n\r\n<h2 id=\"tab2\" >Making more colors on your Raspberry Pi</h2>\r\nThe trick to making more colors than the simple primary and secondary colors is to have different brightness of each of the three colors. In that way, many more subtle colors can be made. So how can you control the brightness of an LED? Well, the answer might not be immediately apparent, but what you need to do is to turn the LED on and off very rapidly. If you do this fast enough — that is, faster than about 30 times a second — then the eye/brain sees this as a light that is constantly on and not flickering.\r\n\r\nFurthermore, you perceive the brightness of the LED according to the relative length of the On and Off times. That is, if the LED is on and off for equal times, the LED appears to be only half as bright. This rapid switching technique is known as PWM — short for <em>P</em>ulse-<em>W</em>idth <em>M</em>odulation — and is the way you control the LED's brightness. The waveforms are shown here.\r\n\r\n[caption id=\"attachment_246377\" align=\"aligncenter\" width=\"336\"]<img class=\"wp-image-246377 size-full\" src=\"https://www.dummies.com/wp-content/uploads/raspberry-pi-3e-pwm-signal.jpg\" alt=\"PWM signal for LEDs\" width=\"336\" height=\"156\" /> A PWM signal controlling the LED's brightness.[/caption]\r\n\r\nYou can see that the three PWM signals go on an off at the same speed; however, the one that spends more time being on is brighter than the one that spends only half the time being on. Finally, the last waveform has a little time on but a long time off and produces a dim LED. The ratio of the On time to the Off time is known as the <em>duty cycle</em> of the waveform. Note that the frequency of this PWM signal does not matter once it is above the rate where you see it flicker.\r\n\r\nThe RPi.GPIO library has the ability to make the GPIO pins output a PWM signal, and the library can set both the frequency and duty cycle. If you wire up an RGB LED according to the image above, you can test out the colors an RGB LED can produce with this code.\r\n\r\n<code>#!/usr/bin/python3</code>\r\n\r\n<code>import time</code>\r\n\r\n<code>import RPi.GPIO as io</code>\r\n\r\n \r\n\r\n<code>io.setmode(io.BCM)</code>\r\n\r\n<code>io.setup(17,io.OUT) # make pins into an output</code>\r\n\r\n<code>io.setup(27,io.OUT)</code>\r\n\r\n<code>io.setup(22,io.OUT)</code>\r\n\r\n \r\n\r\n<code>ledR = io.PWM(17,60) # Set up outputs as PWM @ 60Hz</code>\r\n\r\n<code>ledG = io.PWM(27,60)</code>\r\n\r\n<code>ledB = io.PWM(22,60)</code>\r\n\r\n \r\n\r\n<code>ledR.start(0) # start off the PWM</code>\r\n\r\n<code>ledG.start(0)</code>\r\n\r\n<code>ledB.start(0)</code>\r\n\r\n \r\n\r\n<code>print(\"RGB color cycle an LED using RPi.GPIO - By Mike Cook\")</code>\r\n\r\n<code>print(\"Ctrl C to quit\")</code>\r\n\r\n<code>try:</code>\r\n\r\n<code>while(1):</code>\r\n\r\n<code>print(\"Start cycle\")</code>\r\n\r\n<code>time.sleep(2.0)</code>\r\n\r\n<code>for stepR in range(0,100,5):</code>\r\n\r\n<code>for stepG in range(0,100,5):</code>\r\n\r\n<code>for stepB in range(0,100,5):</code>\r\n\r\n<code>ledR.ChangeDutyCycle(stepR)</code>\r\n\r\n<code>ledG.ChangeDutyCycle(stepG)</code>\r\n\r\n<code>ledB.ChangeDutyCycle(stepB)</code>\r\n\r\n<code>time.sleep(0.1) # Whole cycle 8000 times this</code>\r\n\r\n<code>ledR.ChangeDutyCycle(0)</code>\r\n\r\n<code>ledG.ChangeDutyCycle(0)</code>\r\n\r\n<code>ledB.ChangeDutyCycle(0)</code>\r\n\r\n \r\n\r\n<code>except KeyboardInterrupt:</code>\r\n\r\n<code>pass</code>\r\n\r\n \r\n\r\n<code>ledR.stop(0) #stop the PWM</code>\r\n\r\n<code>ledG.stop(0)</code>\r\n\r\n<code>ledB.stop(0)</code>\r\n\r\n<code>io.cleanup() # Restore default GPIO state</code>\r\n\r\nWhen you walk through this listing, you see that the first thing the code does is set three GPIO pins to be outputs and then set them up to produce a PWM signal. The value <code>60</code> in these opening lines of code is the frequency 60 Hz, which is the frequency the PWM signal will go at. The duty cycle goes from 0, which is off all the time, to 100, which is on all the time.\r\n\r\nThe main part of the program consists of three nested <code>for</code> loops, which ensure that all combinations of red, green, and blue are produced in duty cycle steps of five. It takes 800 seconds — just over 13 minutes — to do a complete cycle where 8,000 colors are produced. It might not look like that many colors when you test your LED output running this code, but they are all there.\r\n\r\nIt’s just that many of them from this demonstration might look the same. This has to do with the way people perceive colors — they’re much more sensitive to the difference between two colors than to the colors themselves.","description":"Let’s do some fun stuff with your Raspberry Pi’s LEDs: mixing colors. Yes, you can turn on just one LED at a time, and that will give you one of the three colors — red, blue, or green. However, turn two on and the colors will mix in a way known as <em>additive mixing</em>.\r\n\r\nThe primary colors are red, green, and blue. Mixing them together gives you other colors, the so-called <em>secondary</em> colors. So a red-and-green light together make a yellow one. A green-and-blue light make a cyan color, and a red-and-blue light make magenta. Turn on all three LEDs together and you make white — or, more precisely, they make a white tint.\r\n<p class=\"article-tips tech\">In theory, all three LEDs on together will make white, but in practice this depends on the exact brightness of the three separate lights. They have to be identical to make a pure white; otherwise, the white looks tinted, which is not altogether a bad thing. It's not an easy task to do this, because each color has a different forward voltage drop — you need different resistors to ensure the same current through each LED. Not only that, each color of LED converts current to brightness with a different efficiency, which complicates things tremendously.</p>\r\nYou might be used to mixing colored paint, but keep in mind you get different results doing this than mixing light. Paint mixing is known as <em>subtractive mixing</em> because each paint color you put into the mix takes out (or subtracts) some other color. This is how your color printer works. For subtractive mixing, the primary colors are cyan, magenta, and yellow; red, green, and blue being the secondary colors.\r\n<h2 id=\"tab1\" >Using diffusers</h2>\r\nThe light from three LEDs in the same package will still be seen as three separate points of light, unless there is some sort of diffuser, which allows the light to mix evenly. For individual RGB LEDs, this is sometimes provided by the package or body of the LED itself. Viewing distance alone can provide enough diffusion to mix the colors, but often a diffuser of some sort will help. Diffusers also reduce the brightness per unit area of the LED, making it much easer to take a good color picture.\r\n\r\nYou can use anything that is translucent as a diffuser. Our favorite is a very thin styrene sheet — about 0.5mm thickness is fine and is easy to work with, because it can be cut with scissors. (A good alternative is a simple sheet of paper.) If you have several LEDs and want to see the light from each distinctly, then you have to have each one surrounded by a light baffle — sometimes known loosely as an <em>egg box,</em> or <em>waffle box.</em>\r\n\r\nWithout the baffle, the light from each LED mixes with those adjacent to it and gives a soft focus effect that is not at all unpleasant. The degree of diffusion you get is proportional to not only the diffusing material but also the distance of that material from the LED. In most cases, a few millimeters is fine.\r\n<p class=\"article-tips tip\">You can turn the clear-plastic housing LED into a diffuser by rubbing it gently with very fine sandpaper or wire wool. Even better is to use a foam-backed sanding block, because it gets round the curves much better than paper. These LED housings are made of resin, so solvents like acetone do not affect the surface.</p>\r\n\r\n<h2 id=\"tab2\" >Making more colors on your Raspberry Pi</h2>\r\nThe trick to making more colors than the simple primary and secondary colors is to have different brightness of each of the three colors. In that way, many more subtle colors can be made. So how can you control the brightness of an LED? Well, the answer might not be immediately apparent, but what you need to do is to turn the LED on and off very rapidly. If you do this fast enough — that is, faster than about 30 times a second — then the eye/brain sees this as a light that is constantly on and not flickering.\r\n\r\nFurthermore, you perceive the brightness of the LED according to the relative length of the On and Off times. That is, if the LED is on and off for equal times, the LED appears to be only half as bright. This rapid switching technique is known as PWM — short for <em>P</em>ulse-<em>W</em>idth <em>M</em>odulation — and is the way you control the LED's brightness. The waveforms are shown here.\r\n\r\n[caption id=\"attachment_246377\" align=\"aligncenter\" width=\"336\"]<img class=\"wp-image-246377 size-full\" src=\"https://www.dummies.com/wp-content/uploads/raspberry-pi-3e-pwm-signal.jpg\" alt=\"PWM signal for LEDs\" width=\"336\" height=\"156\" /> A PWM signal controlling the LED's brightness.[/caption]\r\n\r\nYou can see that the three PWM signals go on an off at the same speed; however, the one that spends more time being on is brighter than the one that spends only half the time being on. Finally, the last waveform has a little time on but a long time off and produces a dim LED. The ratio of the On time to the Off time is known as the <em>duty cycle</em> of the waveform. Note that the frequency of this PWM signal does not matter once it is above the rate where you see it flicker.\r\n\r\nThe RPi.GPIO library has the ability to make the GPIO pins output a PWM signal, and the library can set both the frequency and duty cycle. If you wire up an RGB LED according to the image above, you can test out the colors an RGB LED can produce with this code.\r\n\r\n<code>#!/usr/bin/python3</code>\r\n\r\n<code>import time</code>\r\n\r\n<code>import RPi.GPIO as io</code>\r\n\r\n \r\n\r\n<code>io.setmode(io.BCM)</code>\r\n\r\n<code>io.setup(17,io.OUT) # make pins into an output</code>\r\n\r\n<code>io.setup(27,io.OUT)</code>\r\n\r\n<code>io.setup(22,io.OUT)</code>\r\n\r\n \r\n\r\n<code>ledR = io.PWM(17,60) # Set up outputs as PWM @ 60Hz</code>\r\n\r\n<code>ledG = io.PWM(27,60)</code>\r\n\r\n<code>ledB = io.PWM(22,60)</code>\r\n\r\n \r\n\r\n<code>ledR.start(0) # start off the PWM</code>\r\n\r\n<code>ledG.start(0)</code>\r\n\r\n<code>ledB.start(0)</code>\r\n\r\n \r\n\r\n<code>print(\"RGB color cycle an LED using RPi.GPIO - By Mike Cook\")</code>\r\n\r\n<code>print(\"Ctrl C to quit\")</code>\r\n\r\n<code>try:</code>\r\n\r\n<code>while(1):</code>\r\n\r\n<code>print(\"Start cycle\")</code>\r\n\r\n<code>time.sleep(2.0)</code>\r\n\r\n<code>for stepR in range(0,100,5):</code>\r\n\r\n<code>for stepG in range(0,100,5):</code>\r\n\r\n<code>for stepB in range(0,100,5):</code>\r\n\r\n<code>ledR.ChangeDutyCycle(stepR)</code>\r\n\r\n<code>ledG.ChangeDutyCycle(stepG)</code>\r\n\r\n<code>ledB.ChangeDutyCycle(stepB)</code>\r\n\r\n<code>time.sleep(0.1) # Whole cycle 8000 times this</code>\r\n\r\n<code>ledR.ChangeDutyCycle(0)</code>\r\n\r\n<code>ledG.ChangeDutyCycle(0)</code>\r\n\r\n<code>ledB.ChangeDutyCycle(0)</code>\r\n\r\n \r\n\r\n<code>except KeyboardInterrupt:</code>\r\n\r\n<code>pass</code>\r\n\r\n \r\n\r\n<code>ledR.stop(0) #stop the PWM</code>\r\n\r\n<code>ledG.stop(0)</code>\r\n\r\n<code>ledB.stop(0)</code>\r\n\r\n<code>io.cleanup() # Restore default GPIO state</code>\r\n\r\nWhen you walk through this listing, you see that the first thing the code does is set three GPIO pins to be outputs and then set them up to produce a PWM signal. The value <code>60</code> in these opening lines of code is the frequency 60 Hz, which is the frequency the PWM signal will go at. The duty cycle goes from 0, which is off all the time, to 100, which is on all the time.\r\n\r\nThe main part of the program consists of three nested <code>for</code> loops, which ensure that all combinations of red, green, and blue are produced in duty cycle steps of five. It takes 800 seconds — just over 13 minutes — to do a complete cycle where 8,000 colors are produced. It might not look like that many colors when you test your LED output running this code, but they are all there.\r\n\r\nIt’s just that many of them from this demonstration might look the same. This has to do with the way people perceive colors — they’re much more sensitive to the difference between two colors than to the colors themselves.","blurb":"","authors":[{"authorId":9304,"name":"Sean McManus","slug":"sean-mcmanus","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9304"}},{"authorId":9222,"name":"Mike Cook","slug":"mike-cook","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9222"}}],"primaryCategoryTaxonomy":{"categoryId":33519,"title":"Raspberry Pi","slug":"raspberry-pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":[{"articleId":192609,"title":"How to Pray the Rosary: A Comprehensive Guide","slug":"how-to-pray-the-rosary","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/192609"}},{"articleId":208741,"title":"Kabbalah For Dummies Cheat Sheet","slug":"kabbalah-for-dummies-cheat-sheet","categoryList":["body-mind-spirit","religion-spirituality","kabbalah"],"_links":{"self":"/articles/208741"}},{"articleId":230957,"title":"Nikon D3400 For Dummies Cheat Sheet","slug":"nikon-d3400-dummies-cheat-sheet","categoryList":["home-auto-hobbies","photography"],"_links":{"self":"/articles/230957"}},{"articleId":235851,"title":"Praying the Rosary and Meditating on the Mysteries","slug":"praying-rosary-meditating-mysteries","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/235851"}},{"articleId":284787,"title":"What Your Society Says About You","slug":"what-your-society-says-about-you","categoryList":["academics-the-arts","humanities"],"_links":{"self":"/articles/284787"}}],"inThisArticle":[{"label":"Using diffusers","target":"#tab1"},{"label":"Making more colors on your Raspberry Pi","target":"#tab2"}],"relatedArticles":{"fromBook":[{"articleId":246452,"title":"How to Set Up the Media Center on Your Raspberry Pi","slug":"set-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246452"}},{"articleId":246448,"title":"Navigating the Media Center on Your Raspberry Pi","slug":"navigating-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246448"}},{"articleId":246445,"title":"How to Change the Settings on Your Raspberry Pi","slug":"change-settings-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246445"}},{"articleId":246442,"title":"How to Use Music Samples on Your Raspberry Pi","slug":"use-music-samples-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246442"}},{"articleId":246439,"title":"How to Use Python to Access GPIO Pins on Your Raspberry Pi","slug":"use-python-access-gpio-pins-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246439"}}],"fromCategory":[{"articleId":246452,"title":"How to Set Up the Media Center on Your Raspberry Pi","slug":"set-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246452"}},{"articleId":246448,"title":"Navigating the Media Center on Your Raspberry Pi","slug":"navigating-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246448"}},{"articleId":246445,"title":"How to Change the Settings on Your Raspberry Pi","slug":"change-settings-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246445"}},{"articleId":246442,"title":"How to Use Music Samples on Your Raspberry Pi","slug":"use-music-samples-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246442"}},{"articleId":246439,"title":"How to Use Python to Access GPIO Pins on Your Raspberry Pi","slug":"use-python-access-gpio-pins-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246439"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281848,"slug":"raspberry-pi-for-dummies","isbn":"9781119796824","categoryList":["technology","computers","hardware","raspberry-pi"],"amazon":{"default":"https://www.amazon.com/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119796822-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/raspberry-pi-for-dummies-4e-cover-9781119796824-203x255.jpg","width":203,"height":255},"title":"Raspberry Pi For Dummies","testBankPinActivationLink":"","bookOutOfPrint":true,"authorsInfo":"<p><b><b data-author-id=\"9304\">Sean McManus</b> </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p> <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b><b data-author-id=\"9222\">Mike Cook</b> </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","authors":[{"authorId":9304,"name":"Sean McManus","slug":"sean-mcmanus","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9304"}},{"authorId":9222,"name":"Mike Cook","slug":"mike-cook","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9222"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;computers&quot;,&quot;hardware&quot;,&quot;raspberry-pi&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119796824&quot;]}]\" id=\"du-slot-63221a5da0c56\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;computers&quot;,&quot;hardware&quot;,&quot;raspberry-pi&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119796824&quot;]}]\" id=\"du-slot-63221a5da1510\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":null,"lifeExpectancySetFrom":null,"dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":246376},{"headers":{"creationTime":"2017-11-07T12:37:15+00:00","modifiedTime":"2017-11-07T12:37:15+00:00","timestamp":"2022-09-14T18:15:57+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Computers","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33513"},"slug":"computers","categoryId":33513},{"name":"Hardware","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33516"},"slug":"hardware","categoryId":33516},{"name":"Raspberry Pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"},"slug":"raspberry-pi","categoryId":33519}],"title":"Ready-Made Add-On Boards for Your Raspberry Pi","strippedTitle":"ready-made add-on boards for your raspberry pi","slug":"ready-made-add-boards-raspberry-pi","canonicalUrl":"","seo":{"metaDescription":"There are basically two types of ready-made boards for the Raspberry Pi: those designed for making it easy to get access to the GPIO pins and those with compone","noIndex":0,"noFollow":0},"content":"There are basically two types of ready-made boards for the Raspberry Pi: those designed for making it easy to get access to the GPIO pins and those with components that have already been soldered up.\r\n\r\nSince the introduction of the Raspberry Pi in 2012, many companies have produced ready-made boards with all sorts of components already built on. They normally come with sample code to show you how to use them, and many users just stick to that. However, this can be a wasted opportunity because you can always do more with a board than is shown in these examples. Many of these boards contain sensors that allow your Pi programs to measure things. New boards are constantly being developed and produced.\r\n\r\nBoards come in three styles:\r\n<ul>\r\n \t<li>Separate boards that connect to the GPIO pins via a ribbon cable or your own wires.</li>\r\n \t<li>Boards that plug into all the GPIO pins and cover most of the area of the Raspberry Pi board. These are sometimes called <em>shields</em> or <em>plates</em>.</li>\r\n \t<li>Boards similar to the shield/plate variety just mentioned but contain in addition an identification and sometimes software so that the Pi can read what they are on start-up and install some software and prepare the GPIO pins automatically. These are called <a href=\"http://www.raspberrypi.org/introducing-raspberry-pi-hats\">HATs</a> — short for Hardware Attached on Top.</li>\r\n</ul>\r\n<h2 id=\"tab1\" >The Sense HAT</h2>\r\nThe Sense HAT was specifically designed for the Astro-Pi mission and two ruggedised versions were flown on the International Space Station from December 2015 running code written by school children. It has an 8×8 RGB LED matrix, a 5-button joystick, and sensors to measure acceleration, magnetism, temperature, pressure, and humidity — as well as a gyroscope. The Sense HAT also has an extensive Python library associated with it, which allows for easy access to this board. You can find comprehensive coverage of how to use the Sense HAT on the <a href=\"https://www.raspberrypi.org/learning/getting-started-with-the-sense-hat/\">Raspberry Pi Foundation's website</a>.\r\n\r\n[caption id=\"attachment_246373\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-246373 size-full\" src=\"https://www.dummies.com/wp-content/uploads/raspberry-pi-3e-sense-hat.jpg\" alt=\"Sense HAT\" width=\"535\" height=\"401\" /> The Sense HAT.[/caption]\r\n<h2 id=\"tab2\" >The Skywriter HAT</h2>\r\nThe Skywriter HAT is an electric near-field 3D proximity sensor. With it, you can make gestures with your hands waving above it, which can then be detected by the library software, causing your own functions to run. Gestures such as flicks right, left, up, and down can easily be detected along with a circular motion of the finger. It also detects taps made directly to the HAT surface. It has a range of about 5 centimeters and can be mounted behind any nonconducting surface, such as an acrylic sheet.\r\n\r\n[caption id=\"attachment_246372\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-246372 size-full\" src=\"https://www.dummies.com/wp-content/uploads/raspberry-pi-3e-skywriter-hat.jpg\" alt=\"Skywriter HAT\" width=\"535\" height=\"401\" /> The Skywriter HAT.[/caption]\r\n<h2 id=\"tab3\" >The Xtrinsic Sense board</h2>\r\nThe Xtrinsic Sense board is a low-cost sensor board, in some ways similar to the Sensor HAT but without the LEDs. It is made in partnership with the component distributor and Raspberry Pi co-manufacturer Farnell. It contains a high-precision pressure sensor in the range 50 to 110kPa, a 3-axis, digital accelerometer, and a 3D magnetometer. As you can see, it sits over less than half the Raspberry Pi and can be used, among other things, with robots and high-altitude balloons.\r\n\r\n[caption id=\"attachment_246371\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-246371 size-full\" src=\"https://www.dummies.com/wp-content/uploads/raspberry-pi-3e-xtrinsic-board.jpg\" alt=\"Xtrinsic sense board\" width=\"535\" height=\"401\" /> The Xtrinsic Sense board.[/caption]\r\n<h2 id=\"tab4\" >Other boards</h2>\r\nThere are many other boards available from small start-up manufacturers as well as web-based projects for you to build. Here’s a good starting point for <a href=\"http://elinux.org/RPi_Expansion_Boards\">information on expansion boards</a>.","description":"There are basically two types of ready-made boards for the Raspberry Pi: those designed for making it easy to get access to the GPIO pins and those with components that have already been soldered up.\r\n\r\nSince the introduction of the Raspberry Pi in 2012, many companies have produced ready-made boards with all sorts of components already built on. They normally come with sample code to show you how to use them, and many users just stick to that. However, this can be a wasted opportunity because you can always do more with a board than is shown in these examples. Many of these boards contain sensors that allow your Pi programs to measure things. New boards are constantly being developed and produced.\r\n\r\nBoards come in three styles:\r\n<ul>\r\n \t<li>Separate boards that connect to the GPIO pins via a ribbon cable or your own wires.</li>\r\n \t<li>Boards that plug into all the GPIO pins and cover most of the area of the Raspberry Pi board. These are sometimes called <em>shields</em> or <em>plates</em>.</li>\r\n \t<li>Boards similar to the shield/plate variety just mentioned but contain in addition an identification and sometimes software so that the Pi can read what they are on start-up and install some software and prepare the GPIO pins automatically. These are called <a href=\"http://www.raspberrypi.org/introducing-raspberry-pi-hats\">HATs</a> — short for Hardware Attached on Top.</li>\r\n</ul>\r\n<h2 id=\"tab1\" >The Sense HAT</h2>\r\nThe Sense HAT was specifically designed for the Astro-Pi mission and two ruggedised versions were flown on the International Space Station from December 2015 running code written by school children. It has an 8×8 RGB LED matrix, a 5-button joystick, and sensors to measure acceleration, magnetism, temperature, pressure, and humidity — as well as a gyroscope. The Sense HAT also has an extensive Python library associated with it, which allows for easy access to this board. You can find comprehensive coverage of how to use the Sense HAT on the <a href=\"https://www.raspberrypi.org/learning/getting-started-with-the-sense-hat/\">Raspberry Pi Foundation's website</a>.\r\n\r\n[caption id=\"attachment_246373\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-246373 size-full\" src=\"https://www.dummies.com/wp-content/uploads/raspberry-pi-3e-sense-hat.jpg\" alt=\"Sense HAT\" width=\"535\" height=\"401\" /> The Sense HAT.[/caption]\r\n<h2 id=\"tab2\" >The Skywriter HAT</h2>\r\nThe Skywriter HAT is an electric near-field 3D proximity sensor. With it, you can make gestures with your hands waving above it, which can then be detected by the library software, causing your own functions to run. Gestures such as flicks right, left, up, and down can easily be detected along with a circular motion of the finger. It also detects taps made directly to the HAT surface. It has a range of about 5 centimeters and can be mounted behind any nonconducting surface, such as an acrylic sheet.\r\n\r\n[caption id=\"attachment_246372\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-246372 size-full\" src=\"https://www.dummies.com/wp-content/uploads/raspberry-pi-3e-skywriter-hat.jpg\" alt=\"Skywriter HAT\" width=\"535\" height=\"401\" /> The Skywriter HAT.[/caption]\r\n<h2 id=\"tab3\" >The Xtrinsic Sense board</h2>\r\nThe Xtrinsic Sense board is a low-cost sensor board, in some ways similar to the Sensor HAT but without the LEDs. It is made in partnership with the component distributor and Raspberry Pi co-manufacturer Farnell. It contains a high-precision pressure sensor in the range 50 to 110kPa, a 3-axis, digital accelerometer, and a 3D magnetometer. As you can see, it sits over less than half the Raspberry Pi and can be used, among other things, with robots and high-altitude balloons.\r\n\r\n[caption id=\"attachment_246371\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-246371 size-full\" src=\"https://www.dummies.com/wp-content/uploads/raspberry-pi-3e-xtrinsic-board.jpg\" alt=\"Xtrinsic sense board\" width=\"535\" height=\"401\" /> The Xtrinsic Sense board.[/caption]\r\n<h2 id=\"tab4\" >Other boards</h2>\r\nThere are many other boards available from small start-up manufacturers as well as web-based projects for you to build. Here’s a good starting point for <a href=\"http://elinux.org/RPi_Expansion_Boards\">information on expansion boards</a>.","blurb":"","authors":[{"authorId":9304,"name":"Sean McManus","slug":"sean-mcmanus","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9304"}},{"authorId":9222,"name":"Mike Cook","slug":"mike-cook","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9222"}}],"primaryCategoryTaxonomy":{"categoryId":33519,"title":"Raspberry Pi","slug":"raspberry-pi","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33519"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":[{"articleId":192609,"title":"How to Pray the Rosary: A Comprehensive Guide","slug":"how-to-pray-the-rosary","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/192609"}},{"articleId":208741,"title":"Kabbalah For Dummies Cheat Sheet","slug":"kabbalah-for-dummies-cheat-sheet","categoryList":["body-mind-spirit","religion-spirituality","kabbalah"],"_links":{"self":"/articles/208741"}},{"articleId":230957,"title":"Nikon D3400 For Dummies Cheat Sheet","slug":"nikon-d3400-dummies-cheat-sheet","categoryList":["home-auto-hobbies","photography"],"_links":{"self":"/articles/230957"}},{"articleId":235851,"title":"Praying the Rosary and Meditating on the Mysteries","slug":"praying-rosary-meditating-mysteries","categoryList":["body-mind-spirit","religion-spirituality","christianity","catholicism"],"_links":{"self":"/articles/235851"}},{"articleId":284787,"title":"What Your Society Says About You","slug":"what-your-society-says-about-you","categoryList":["academics-the-arts","humanities"],"_links":{"self":"/articles/284787"}}],"inThisArticle":[{"label":"The Sense HAT","target":"#tab1"},{"label":"The Skywriter HAT","target":"#tab2"},{"label":"The Xtrinsic Sense board","target":"#tab3"},{"label":"Other boards","target":"#tab4"}],"relatedArticles":{"fromBook":[{"articleId":246452,"title":"How to Set Up the Media Center on Your Raspberry Pi","slug":"set-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246452"}},{"articleId":246448,"title":"Navigating the Media Center on Your Raspberry Pi","slug":"navigating-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246448"}},{"articleId":246445,"title":"How to Change the Settings on Your Raspberry Pi","slug":"change-settings-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246445"}},{"articleId":246442,"title":"How to Use Music Samples on Your Raspberry Pi","slug":"use-music-samples-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246442"}},{"articleId":246439,"title":"How to Use Python to Access GPIO Pins on Your Raspberry Pi","slug":"use-python-access-gpio-pins-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246439"}}],"fromCategory":[{"articleId":246452,"title":"How to Set Up the Media Center on Your Raspberry Pi","slug":"set-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246452"}},{"articleId":246448,"title":"Navigating the Media Center on Your Raspberry Pi","slug":"navigating-media-center-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246448"}},{"articleId":246445,"title":"How to Change the Settings on Your Raspberry Pi","slug":"change-settings-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246445"}},{"articleId":246442,"title":"How to Use Music Samples on Your Raspberry Pi","slug":"use-music-samples-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246442"}},{"articleId":246439,"title":"How to Use Python to Access GPIO Pins on Your Raspberry Pi","slug":"use-python-access-gpio-pins-raspberry-pi","categoryList":["technology","computers","hardware","raspberry-pi"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/246439"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281848,"slug":"raspberry-pi-for-dummies","isbn":"9781119796824","categoryList":["technology","computers","hardware","raspberry-pi"],"amazon":{"default":"https://www.amazon.com/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119796822-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119796822/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/raspberry-pi-for-dummies-4e-cover-9781119796824-203x255.jpg","width":203,"height":255},"title":"Raspberry Pi For Dummies","testBankPinActivationLink":"","bookOutOfPrint":true,"authorsInfo":"<p><b><b data-author-id=\"9304\">Sean McManus</b> </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p> <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b><b data-author-id=\"9222\">Mike Cook</b> </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","authors":[{"authorId":9304,"name":"Sean McManus","slug":"sean-mcmanus","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9304"}},{"authorId":9222,"name":"Mike Cook","slug":"mike-cook","description":" <p><b>Sean McManus </b>is an expert technology and business author. His previous books include <i>Mission Python, Coder Academy</i>, and <i>Cool Scratch Projects in Easy Steps</i>.</p> <p><b>Mike Cook </b>is a former professor in physics at Manchester Metropolitan University. His other books include <i>Raspberry Pi Projects</i> and <i>Raspberry Pi Projects For Dummies</i>.</p>","hasArticle":false,"_links":{"self":"https://dummies-api.dummies.com/v2/authors/9222"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;computers&quot;,&quot;hardware&quot;,&quot;raspberry-pi&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119796824&quot;]}]\" id=\"du-slot-63221a5d99837\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;computers&quot;,&quot;hardware&quot;,&quot;raspberry-pi&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119796824&quot;]}]\" id=\"du-slot-63221a5d9a0e0\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0},"sponsorAd":"","sponsorEbookTitle":"","sponsorEbookLink":"","sponsorEbookImage":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":null,"lifeExpectancySetFrom":null,"dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":246370}],"_links":{"self":{"self":"https://dummies-api.dummies.com/v2/categories/33519/categoryArticles?sortField=time&sortOrder=1&size=10&offset=0"},"next":{"self":"https://dummies-api.dummies.com/v2/categories/33519/categoryArticles?sortField=time&sortOrder=1&size=10&offset=10"},"last":{"self":"https://dummies-api.dummies.com/v2/categories/33519/categoryArticles?sortField=time&sortOrder=1&size=10&offset=26"}}},"objectTitle":"","status":"success","pageType":"article-category","objectId":"33519","page":1,"sortField":"time","sortOrder":1,"categoriesIds":[],"articleTypes":[],"filterData":{"categoriesFilter":[{"itemId":0,"itemName":"All Categories","count":36}],"articleTypeFilter":[{"articleType":"All Types","count":36},{"articleType":"Articles","count":34},{"articleType":"Cheat Sheet","count":2}]},"filterDataLoadedStatus":"success","pageSize":10},"adsState":{"pageScripts":{"headers":{"timestamp":"2025-04-17T15:50:01+00:00"},"adsId":0,"data":{"scripts":[{"pages":["all"],"location":"header","script":"<!--Optimizely Script-->\r\n<script src=\"https://cdn.optimizely.com/js/10563184655.js\"></script>","enabled":false},{"pages":["all"],"location":"header","script":"<!-- comScore Tag -->\r\n<script>var _comscore = _comscore || [];_comscore.push({ c1: \"2\", c2: \"15097263\" });(function() {var s = document.createElement(\"script\"), el = document.getElementsByTagName(\"script\")[0]; s.async = true;s.src = (document.location.protocol == \"https:\" ? \"https://sb\" : \"http://b\") + \".scorecardresearch.com/beacon.js\";el.parentNode.insertBefore(s, el);})();</script><noscript><img src=\"https://sb.scorecardresearch.com/p?c1=2&c2=15097263&cv=2.0&cj=1\" /></noscript>\r\n<!-- / comScore Tag -->","enabled":true},{"pages":["all"],"location":"footer","script":"<!--BEGIN QUALTRICS WEBSITE FEEDBACK SNIPPET-->\r\n<script type='text/javascript'>\r\n(function(){var g=function(e,h,f,g){\r\nthis.get=function(a){for(var a=a+\"=\",c=document.cookie.split(\";\"),b=0,e=c.length;b<e;b++){for(var d=c[b];\" \"==d.charAt(0);)d=d.substring(1,d.length);if(0==d.indexOf(a))return d.substring(a.length,d.length)}return null};\r\nthis.set=function(a,c){var b=\"\",b=new Date;b.setTime(b.getTime()+6048E5);b=\"; expires=\"+b.toGMTString();document.cookie=a+\"=\"+c+b+\"; path=/; \"};\r\nthis.check=function(){var a=this.get(f);if(a)a=a.split(\":\");else if(100!=e)\"v\"==h&&(e=Math.random()>=e/100?0:100),a=[h,e,0],this.set(f,a.join(\":\"));else return!0;var c=a[1];if(100==c)return!0;switch(a[0]){case \"v\":return!1;case \"r\":return c=a[2]%Math.floor(100/c),a[2]++,this.set(f,a.join(\":\")),!c}return!0};\r\nthis.go=function(){if(this.check()){var a=document.createElement(\"script\");a.type=\"text/javascript\";a.src=g;document.body&&document.body.appendChild(a)}};\r\nthis.start=function(){var t=this;\"complete\"!==document.readyState?window.addEventListener?window.addEventListener(\"load\",function(){t.go()},!1):window.attachEvent&&window.attachEvent(\"onload\",function(){t.go()}):t.go()};};\r\ntry{(new g(100,\"r\",\"QSI_S_ZN_5o5yqpvMVjgDOuN\",\"https://zn5o5yqpvmvjgdoun-wiley.siteintercept.qualtrics.com/SIE/?Q_ZID=ZN_5o5yqpvMVjgDOuN\")).start()}catch(i){}})();\r\n</script><div id='ZN_5o5yqpvMVjgDOuN'><!--DO NOT REMOVE-CONTENTS PLACED HERE--></div>\r\n<!--END WEBSITE FEEDBACK SNIPPET-->","enabled":false},{"pages":["all"],"location":"header","script":"<!-- Hotjar Tracking Code for http://www.dummies.com -->\r\n<script>\r\n (function(h,o,t,j,a,r){\r\n h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};\r\n h._hjSettings={hjid:257151,hjsv:6};\r\n a=o.getElementsByTagName('head')[0];\r\n r=o.createElement('script');r.async=1;\r\n r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;\r\n a.appendChild(r);\r\n })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');\r\n</script>","enabled":false},{"pages":["article"],"location":"header","script":"<!-- //Connect Container: dummies --> <script src=\"//get.s-onetag.com/bffe21a1-6bb8-4928-9449-7beadb468dae/tag.min.js\" async defer></script>","enabled":true},{"pages":["homepage"],"location":"header","script":"<meta name=\"facebook-domain-verification\" content=\"irk8y0irxf718trg3uwwuexg6xpva0\" />","enabled":true},{"pages":["homepage","article","category","search"],"location":"footer","script":"<!-- Facebook Pixel Code -->\r\n<noscript>\r\n<img height=\"1\" width=\"1\" src=\"https://www.facebook.com/tr?id=256338321977984&ev=PageView&noscript=1\"/>\r\n</noscript>\r\n<!-- End Facebook Pixel Code -->","enabled":true}]}},"pageScriptsLoadedStatus":"success"},"navigationState":{"navigationCollections":[{"collectionId":287568,"title":"BYOB (Be Your Own Boss)","hasSubCategories":false,"url":"/collection/for-the-entry-level-entrepreneur-287568"},{"collectionId":293237,"title":"Be a Rad Dad","hasSubCategories":false,"url":"/collection/be-the-best-dad-293237"},{"collectionId":295890,"title":"Career Shifting","hasSubCategories":false,"url":"/collection/career-shifting-295890"},{"collectionId":294090,"title":"Contemplating the Cosmos","hasSubCategories":false,"url":"/collection/theres-something-about-space-294090"},{"collectionId":287563,"title":"For Those Seeking Peace of Mind","hasSubCategories":false,"url":"/collection/for-those-seeking-peace-of-mind-287563"},{"collectionId":287570,"title":"For the Aspiring Aficionado","hasSubCategories":false,"url":"/collection/for-the-bougielicious-287570"},{"collectionId":291903,"title":"For the Budding Cannabis Enthusiast","hasSubCategories":false,"url":"/collection/for-the-budding-cannabis-enthusiast-291903"},{"collectionId":299891,"title":"For the College Bound","hasSubCategories":false,"url":"/collection/for-the-college-bound-299891"},{"collectionId":291934,"title":"For the Exam-Season Crammer","hasSubCategories":false,"url":"/collection/for-the-exam-season-crammer-291934"},{"collectionId":301547,"title":"For the Game Day Prepper","hasSubCategories":false,"url":"/collection/big-game-day-prep-made-easy-301547"}],"navigationCollectionsLoadedStatus":"success","navigationCategories":{"books":{"0":{"data":[{"categoryId":33512,"title":"Technology","hasSubCategories":true,"url":"/category/books/technology-33512"},{"categoryId":33662,"title":"Academics & The Arts","hasSubCategories":true,"url":"/category/books/academics-the-arts-33662"},{"categoryId":33809,"title":"Home, Auto, & Hobbies","hasSubCategories":true,"url":"/category/books/home-auto-hobbies-33809"},{"categoryId":34038,"title":"Body, Mind, & Spirit","hasSubCategories":true,"url":"/category/books/body-mind-spirit-34038"},{"categoryId":34224,"title":"Business, Careers, & Money","hasSubCategories":true,"url":"/category/books/business-careers-money-34224"}],"breadcrumbs":[],"categoryTitle":"Level 0 Category","mainCategoryUrl":"/category/books/level-0-category-0"}},"articles":{"0":{"data":[{"categoryId":33512,"title":"Technology","hasSubCategories":true,"url":"/category/articles/technology-33512"},{"categoryId":33662,"title":"Academics & The Arts","hasSubCategories":true,"url":"/category/articles/academics-the-arts-33662"},{"categoryId":33809,"title":"Home, Auto, & Hobbies","hasSubCategories":true,"url":"/category/articles/home-auto-hobbies-33809"},{"categoryId":34038,"title":"Body, Mind, & Spirit","hasSubCategories":true,"url":"/category/articles/body-mind-spirit-34038"},{"categoryId":34224,"title":"Business, Careers, & Money","hasSubCategories":true,"url":"/category/articles/business-careers-money-34224"}],"breadcrumbs":[],"categoryTitle":"Level 0 Category","mainCategoryUrl":"/category/articles/level-0-category-0"}}},"navigationCategoriesLoadedStatus":"success"},"searchState":{"searchList":[],"searchStatus":"initial","relatedArticlesList":[],"relatedArticlesStatus":"initial"},"routeState":{"name":"ArticleCategory","path":"/category/articles/raspberry-pi-33519/","hash":"","query":{},"params":{"category":"raspberry-pi-33519"},"fullPath":"/category/articles/raspberry-pi-33519/","meta":{"routeType":"category","breadcrumbInfo":{"suffix":"Articles","baseRoute":"/category/articles"},"prerenderWithAsyncData":true},"from":{"name":null,"path":"/","hash":"","query":{},"params":{},"fullPath":"/","meta":{}}},"profileState":{"auth":{},"userOptions":{},"status":"success"}}
Logo
  • Articles Open Article Categories
  • Books Open Book Categories
  • Collections Open Collections list
  • Custom Solutions

Article Categories

Book Categories

Collections

Explore all collections
BYOB (Be Your Own Boss)
Be a Rad Dad
Career Shifting
Contemplating the Cosmos
For Those Seeking Peace of Mind
For the Aspiring Aficionado
For the Budding Cannabis Enthusiast
For the College Bound
For the Exam-Season Crammer
For the Game Day Prepper
Log In
  • Home
  • Technology Articles
  • Computers Articles
  • Hardware Articles
  • Raspberry Pi Articles

Raspberry Pi Articles

Get started with the sweetest little computer around. Then, try a helping of the advanced stuff, like facial recognition, programming, and IoT projects.

Articles From Raspberry Pi

page 1
page 2
page 3
page 4

Filter Results

36 results
36 results
Raspberry Pi Raspberry Pi For Dummies Cheat Sheet

Cheat Sheet / Updated 03-14-2022

The Raspberry Pi is perhaps the most inspiring computer available today. It comes with the tools you need to start making your own software, and you can connect your own electronic inventions to it. These tips show you how to discover and install great free software on your Raspberry Pi and how to program in Scratch.

View Cheat Sheet
Raspberry Pi How to Set Up the Media Center on Your Raspberry Pi

Article / Updated 11-08-2017

The Raspberry Pi can play back full HD 1080p video, which makes it ideal as the heart of a cheap and low-powered media center. The NOOBS software includes two Linux distributions, both based on Kodi, that turn your Raspberry Pi into a media center. The choices are OSMC and LibreELEC. Because they’re both based on the Kodi core, they have many similarities. LibreELEC uses the default Kodi design (or skin), so it's more likely to resemble other Kodi systems you have used. It's also a more lightweight option, so it may perform better on lower-powered Raspberry Pi models. To make it easier, you can choose the default Kodi skin by clicking Settings on the left, choosing Interface from the menu that appears, and then choosing Skin. Click Skin in the main part of the screen to open the options and choose Estuary, which is the Kodi default. You can change back to the OSMC skin from Estuary by clicking the Cogwheel icon at the top of the menu on the left, choosing Interface Settings from the menu that appears, hovering over Skin on the left, and then clicking Skin in the main part of the screen. You can exit any of the menus by pressing Esc. To start setting up your media center, create an SD or MicroSD card with NOOBS Lite on it, and then use that card to install LibreELEC. When you first boot up LibreELEC, you'll be guided through its main settings, including its name on the network, the network connection itself, and the remote access settings (so that you can access files on your device over the network).

View Article
Raspberry Pi Navigating the Media Center on Your Raspberry Pi

Article / Updated 11-08-2017

The Kodi screen on your Raspberry Pi looks like what you see here. LibreELEC uses Kodi’s simple interface, which is designed to work with only a remote control. If you’re using a remote control, you should find the interface intuitive. The menu on the left side of the screen gives you access to the different content types, including movies, TV shows, music, and music videos. When you hover the mouse pointer over one of these options, the main screen area on the right shows you options and submenus for accessing your content. The Music section, for example, shows you categories you can browse, recently played albums, recently added albums, random albums, random artists, unplayed albums, and most played albums. You can use the cursor keys to move around the options; or the mouse, with the scroll wheel moving between the options within a menu. To exit a menu, press the Escape key. To select an item and start to play it, simply click it. You can pause playback by tapping the spacebar, and tap Escape to get back to the menu. To use the TV and radio features, you'll need to have a separate tuner device and TV signal decoding software. At the top of the menu on the left are buttons for switching off your Pi, accessing the settings menus (the Cogwheel icon), and searching for content (the magnifying glass).

View Article
Raspberry Pi How to Change the Settings on Your Raspberry Pi

Article / Updated 11-08-2017

Need to do some tweaking? You can change the settings on your Raspberry Pi easily enough. The cogwheel at the top of the main menu gives you access to the settings for Kodi, divided into several sections. They include, among others: Player settings, covering options such as whether the next song or video plays automatically, whether there is cross-fading between songs, and the use of subtitles. Media settings, which enable you to manage your sources of media in the library and choose information providers for artist and album information. Interface settings, which enable you to choose a skin (or design) for Kodi, your region, and a screensaver. If you install a screensaver add-on, you'll need to enable it here. System settings, which can be used to choose the correct audio output device, configure notification sounds in Kodi, and configure power and the Internet connection. LibreELEC, which includes options for managing the Internet connections available to the system and for enabling Secure Shell (SSH) for remote access to your Pi. File Manager, which enables you to copy files between different folders and storage devices. By default, the sound is set to pass through your HDMI cable. If you want to use your Raspberry Pi’s audio output (and speakers) but you’re using HDMI for your screen, you’ll need to change the audio setting from HDMI to Analog. You’ll find this option on Kodi's System Settings menu. When you’re viewing the settings menu, select Audio on the left and select Audio Output.

View Article
Raspberry Pi How to Use Music Samples on Your Raspberry Pi

Article / Updated 11-08-2017

You can use your Raspberry Pi to compose your own tunes or Sonic Pi can also use samples, which are snippets of music that you can manipulate, such as by changing their speed or adding effects to them. Sonic Pi includes a wide range of samples, and you can see a list of them by showing the Help pane and then using the Sample button in the bottom left. They're especially useful for adding drum loops to your music. Here’s a favorite: sample :loop_industrial Put that into a new buffer and click Run to hear it. You can speed it up or slow it down by changing its rate. Here’s how you make it play at half its normal speed: sample :loop_industrial, rate: 0.5 You can repeat that sample to make a continuous rhythm. Similar to composing your own music, you can use the sleep command to put a pause between each repetition. Samples can be different lengths, however, which can make it difficult to work out how long to sleep. Luckily, Sonic Pi provides a feature in the language to stretch a sample over a certain number of beats, which solves this problem. You can use it like this: loop do sample :loop_industrial, beat_stretch: 2 sleep 2 end Now the sample is stretched over 2 beats, and there is a 2-beat pause between each repetition. As a result, you can hear a continuous rhythm. As you saw when experimenting with live loops, you can change the tempo with the use_bpm command.

View Article
Raspberry Pi How to Use Python to Access GPIO Pins on Your Raspberry Pi

Article / Updated 11-08-2017

You can access GPIO pins on your Raspberry Pi with Python. Unlike Scratch's graphic-based program blocks, Python uses entirely text-based instructions. Its great power is that the basic Python language can be extended to do more things by the use of libraries. These are functions that can be written in Python or any other language to extend what Python can do. When using Python to access the GPIO pins, you have a number of different libraries you could choose that can give you access to them. They can provide not only normal input/output access but also access to some of the special functions or capabilities of certain pins. In the early days of the Raspberry Pi, the only access to the GPIO pins was if you were running in Supervisor, or Root, mode. Fortunately, this has now been changed so that you can run in normal User mode with most libraries. While the newly introduced Thonny Python IDE (Integrated Development Environment) is popular with beginners, our preferred environment for writing Python is IDLE3 (it has more features), but either can be used. IDLE3 and Thonny can both be accessed from the main Desktop Raspberry menu. So, pick the one of your choice and create a new file, and then type in the program you see below. Remember that, in Python, the case of a word matters as does the spaces at the start of a line, so be sure to get them right; otherwise, you will get errors when trying to run your code. #!/usr/bin/python3 import time import RPi.GPIO as io # using RPi.GPIO io.setmode(io.BCM) io.setup(4,io.OUT) # make pin into an output print("LED blinker - By Mike Cook") print("Ctrl C to quit") while True: io.output(4,0) time.sleep(0.30) io.output(4,1) time.sleep(0.30) Save the file and run it. Your LED blinks just like the Scratch example. Take a look at the code line by line. The program starts by importing the support packages you need. In this case, it’s the time package used to achieve a Delay, or Wait, function, and the RPi.GPIO package to access the GPIO pins. Note here that a lot of examples use as GPIO in the import statement — but you can use the simpler and shorter as io because it reduces the amount of typing and you don't have to keep switching to uppercase. Then you have to tell the library what sort of numbering system you want to use. We’re using the now-standard BCM system. The next line tells the GPIO pins that you want to use Pin 4 as an output. The setup method takes two values: the pin number and a number that tells the library to make that pin an output. This is conveniently hidden by the library, by using a predefined constant that’s defined in the library — that’s why it’s prefixed with io. Next, the loop forever of Scratch is carried out in Python with the use of the while True statement, with all statements in this loop indented. This loop then commands the GPIO Pin 4 to be a 0, turning the LED off. Then there’s a delay (or sleep) for 300mS, followed by turning the LED on by making Pin 4 go high. Finally, there’s another delay, so you can see the LED in the On state. A common mistake is to leave out this last delay; as a result, the LED looks to be off all the time. So, controlling a GPIO output is very simple. Now, on to the second example of a switch-controlled blink speed. This is shown below, so open up a new file and type it in. #!/usr/bin/python3 io.setmode(io.BCM) io.setup(4,io.OUT) # make pin into an output io.setup(24,io.IN, pull_up_down=io.PUD_UP) # make pin an input print("LED blinker - By Mike Cook") print("Ctrl C to quit") while True: io.output(4,0) if io.input(24) == 1: time.sleep(0.30) else : time.sleep(1.00) io.output(4,1) if io.input(24) == 1: time.sleep(0.30) else : time.sleep(1.00) This code has the same commands for the output pin, but the input pin setup is new. This command has three parameters: the number of the pin to use, a number in the form of a constant defined by the library, specifying that this pin should function as an input, and, finally, some commands telling the computer to activate the internal pull-up resistor (although, to our ears, PUD_UP sounds more like a mother calling children to tell them their pudding is being served). The LED is first turned off as before, and then the input from the push button is read by the input(24) method, which returns a value of 0 or 1, depending on whether the pin is connected to the ground. This returned value is then compared to 1, and if it’s equal, a 300mS delay is made; otherwise, it produces a 1-second delay. The LED is turned on, and the Conditional Delay code is repeated.

View Article
Raspberry Pi How to Use GPIO ZERO on Your Raspberry Pi

Article / Updated 11-08-2017

There’s a new kid on the block when it comes to accessing the GPIO pins in Python on your Raspberry Pi: the GPIO Zero library. Don't confuse this with the Pi Zero — the two are not related. The GPIO Zero library takes the class method approach to control, as opposed to the function method approach of RPi.GPIO and other, similar libraries. Pins become Python objects, which must be set up before use. Despite this complication, using this system is easy. For example, for an LED blink example, you can use this code #!/usr/bin/python3 import time, os import gpiozero as io # using LED zero led = io.LED(4) # make pin 4 into an output print("LED blinker using gpiozero - By Mike Cook") print("Ctrl C to quit") while True: led.on() time.sleep(0.30) led.off() time.sleep(0.30) The library uses only the BCM method of pin numbering, so there’s no need to tell the library what system to use. An output pin is known as an LED, irrespective of whether that pin controls an LED, a motor, or a chip. So, the line that makes the pin an output is io.LED(4). This code segment returns a reference to the class object. Classes and objects are a way to get the same piece of code to handle different specific objects — in this particular case, different GPIO pins. In order to know what it has to do, each thing/pin must be declared separately, and when it is, the program gets a code number to use to identify which specific thing it has to handle. That code number is placed into a variable called led in code above, but could be called anything. (This variable is known as the instance reference.) The class has methods associated with it — things it can do, in other words — and these are called up by writing the instance reference variable name, followed by a period or dot, followed by the method name. So, turning an LED on or off is a simple process — you just write led.on() or led.off(). However, in a way, this is a bit limiting. For example, you cannot send a number in a variable that’s used to turn the LED on or off — it has to be specifically spelt out as a method name. This is a limitation of how GPIO Zero is written, not a limitation of using classes. There are ways round this, but at this point, the simple system gets rather complex. In fact, the code above is written in a way that it looks a lot like the earlier listings. The same thing could simply be written as shown. import gpiozeroled = LED(4) led.blink() And that’s all you need. That last statement can have some parameters in it to control the blink rate — so, for example, to exactly match our other examples that last line could be: led.blink(on_time = 0.3, off_time = 0.3) This library has even more tricks up its sleeve. If you want to fade that LED up and down instead of just blinking, that last line could say led.blink(on_time = 2.0, off_time = 2.0, fade_in_time = 1.0, fade_out_time = 1.0 ) This is great if you only want to do that, and for a very young beginner, that’s exactly what you want to do. The blinking speed controlled by a push button can be written like this. #!/usr/bin/python3 import time, os import gpiozero as io # using GPIO Zero led = io.LED(4) # make pin 4 into an output push = io.Button(24) # make pin 24 into an input print("LED blinker switch using gpiozero - By Mike Cook") print("Ctrl C to quit") while True: led.on() if push.is_pressed: time.sleep(0.30) else : time.sleep(1.00) led.off() if push.is_pressed: time.sleep(0.30) else : time.sleep(1.00) The input works in a similar way to the output. In this case, you make an instance of the Button class and put its reference in the variable push. Then you use the is_pressed method of this class to determine the time delay in the blinking. By default, the input pull-up resistor is enabled when you create the class reference. There are other options contained in this input class. It can specify whether a press is to be auto-repeated or specify a debounce time — the time after a change to ignore further changes. As well as the is.pressed method, other class methods include is_held, wait_for_press, wait_for_release, is_held, when_held, when_pressed, and when_released. Rather than return any information about the input, these last two cause a function to run when the button is pressed or released. This other function runs in a separate thread — in effect, another separate program — with this thread and the main code being swapped in and out alternately until the function is complete. This gives a beginner access to complex concepts that they need to understand only when something goes wrong. So, our controlled blink-rate program could be written as shown. #!/usr/bin/python3 import gpiozero as io # using LED zero from signal import pause led = io.LED(4) # make pin 4 into an output push = io.Button(24) # make pin 24 into an input def blinkFast(): led.blink(on_time = 0.3, off_time = 0.3) def blinkSlow(): led.blink(on_time = 1.0, off_time = 1.0) push.when_pressed = blinkFast push.when_released = blinkSlow pause() The pause function, in effect, ends the program, and the only thing that happens is when the callback functions, as they are called, are invoked or triggered on the push or release of the button. A lot of the programming work involved in using GIPO Zero involves leafing through the documentation to see what simple functions the authors have implemented for you. GPIO Zero enables you to get results quickly, and without needing to understand much of what is going on — which is helpful if a function does what you need. However, although some things can be done simply, the skills learned are not exactly transferable. As you develop more complex electronic projects, you might find GPIO Zero to be too limited for your needs.

View Article
Raspberry Pi How to Use Note and Chord Names to Make Music on Your Raspberry Pi

Article / Updated 11-07-2017

Sonic Pi enables you to use proper note names instead of MIDI numbers to play music on the RaspberryPi by using the name of the note (a letter from A to G), plus the number of the octave it’s in. For example, to play a middle C, you can use play :c4 To play the B one note before it, which is in the next lowest octave, you would use play :b3 The Log shows that Sonic Pi plays notes 60 and 59 respectively. You can check the note names and numbers to confirm that this is what you expected. MIDI Notes Note 0 1 2 3 4 5 6 7 8 9 C 0 12 24 36 48 60 72 84 96 108 120 C# 1 13 25 37 49 61 73 85 97 109 121 D 2 14 26 38 50 62 74 86 98 110 122 D# 3 15 27 39 51 63 75 87 99 111 123 E 4 16 28 40 52 64 76 88 100 112 124 F 5 17 29 41 53 65 77 89 101 113 125 F# 6 18 30 42 54 66 78 90 102 114 126 G 7 19 31 43 55 67 79 91 103 115 127 G# 8 20 32 44 56 68 80 92 104 116 A 9 21 33 45 57 69 81 93 105 117 A# 10 22 34 46 58 70 82 94 106 118 B 11 23 35 47 59 71 83 95 107 119 Here's how you could code a fanfare using note names instead of numbers: play :c4 sleep 0.5 play :e4 sleep 0.5 play :g4 sleep 0.5 play :c5 If you want to use a sharp note, insert the letter s in the note name (for example, play :cs4) and use b for a flat note (play :cb4). You can also use names to play chords. You tell Sonic Pi the lowest note in the chord and add which type of chord you want (try :major, :minor, or :diminished). There are also options for :major7, :minor7, :diminished7, and :dom7, among others. For a complete list, click Lang in the Help pane, and then select Chord. Try this: play chord(:a3, :major) sleep 1 play chord(:a3, :minor) In each case, it plays three notes at the same time. If you look at the note numbers in the Log, you can see that the middle note was one pitch lower in the second chord because it’s a minor chord. Again, you can use Table 14-1 to check the note numbers Sonic Pi displays against the musical note names. The chord is returned as a list, and you can use play_pattern to hear the notes of the chord in a sequence, like this: play_pattern chord(:a3, :major) play_pattern chord(:a3, :minor)

View Article
Raspberry Pi How to Make Colors with LEDs on Your Raspberry Pi

Article / Updated 11-07-2017

Let’s do some fun stuff with your Raspberry Pi’s LEDs: mixing colors. Yes, you can turn on just one LED at a time, and that will give you one of the three colors — red, blue, or green. However, turn two on and the colors will mix in a way known as additive mixing. The primary colors are red, green, and blue. Mixing them together gives you other colors, the so-called secondary colors. So a red-and-green light together make a yellow one. A green-and-blue light make a cyan color, and a red-and-blue light make magenta. Turn on all three LEDs together and you make white — or, more precisely, they make a white tint. In theory, all three LEDs on together will make white, but in practice this depends on the exact brightness of the three separate lights. They have to be identical to make a pure white; otherwise, the white looks tinted, which is not altogether a bad thing. It's not an easy task to do this, because each color has a different forward voltage drop — you need different resistors to ensure the same current through each LED. Not only that, each color of LED converts current to brightness with a different efficiency, which complicates things tremendously. You might be used to mixing colored paint, but keep in mind you get different results doing this than mixing light. Paint mixing is known as subtractive mixing because each paint color you put into the mix takes out (or subtracts) some other color. This is how your color printer works. For subtractive mixing, the primary colors are cyan, magenta, and yellow; red, green, and blue being the secondary colors. Using diffusers The light from three LEDs in the same package will still be seen as three separate points of light, unless there is some sort of diffuser, which allows the light to mix evenly. For individual RGB LEDs, this is sometimes provided by the package or body of the LED itself. Viewing distance alone can provide enough diffusion to mix the colors, but often a diffuser of some sort will help. Diffusers also reduce the brightness per unit area of the LED, making it much easer to take a good color picture. You can use anything that is translucent as a diffuser. Our favorite is a very thin styrene sheet — about 0.5mm thickness is fine and is easy to work with, because it can be cut with scissors. (A good alternative is a simple sheet of paper.) If you have several LEDs and want to see the light from each distinctly, then you have to have each one surrounded by a light baffle — sometimes known loosely as an egg box, or waffle box. Without the baffle, the light from each LED mixes with those adjacent to it and gives a soft focus effect that is not at all unpleasant. The degree of diffusion you get is proportional to not only the diffusing material but also the distance of that material from the LED. In most cases, a few millimeters is fine. You can turn the clear-plastic housing LED into a diffuser by rubbing it gently with very fine sandpaper or wire wool. Even better is to use a foam-backed sanding block, because it gets round the curves much better than paper. These LED housings are made of resin, so solvents like acetone do not affect the surface. Making more colors on your Raspberry Pi The trick to making more colors than the simple primary and secondary colors is to have different brightness of each of the three colors. In that way, many more subtle colors can be made. So how can you control the brightness of an LED? Well, the answer might not be immediately apparent, but what you need to do is to turn the LED on and off very rapidly. If you do this fast enough — that is, faster than about 30 times a second — then the eye/brain sees this as a light that is constantly on and not flickering. Furthermore, you perceive the brightness of the LED according to the relative length of the On and Off times. That is, if the LED is on and off for equal times, the LED appears to be only half as bright. This rapid switching technique is known as PWM — short for Pulse-Width Modulation — and is the way you control the LED's brightness. The waveforms are shown here. You can see that the three PWM signals go on an off at the same speed; however, the one that spends more time being on is brighter than the one that spends only half the time being on. Finally, the last waveform has a little time on but a long time off and produces a dim LED. The ratio of the On time to the Off time is known as the duty cycle of the waveform. Note that the frequency of this PWM signal does not matter once it is above the rate where you see it flicker. The RPi.GPIO library has the ability to make the GPIO pins output a PWM signal, and the library can set both the frequency and duty cycle. If you wire up an RGB LED according to the image above, you can test out the colors an RGB LED can produce with this code. #!/usr/bin/python3 import time import RPi.GPIO as io io.setmode(io.BCM) io.setup(17,io.OUT) # make pins into an output io.setup(27,io.OUT) io.setup(22,io.OUT) ledR = io.PWM(17,60) # Set up outputs as PWM @ 60Hz ledG = io.PWM(27,60) ledB = io.PWM(22,60) ledR.start(0) # start off the PWM ledG.start(0) ledB.start(0) print("RGB color cycle an LED using RPi.GPIO - By Mike Cook") print("Ctrl C to quit") try: while(1): print("Start cycle") time.sleep(2.0) for stepR in range(0,100,5): for stepG in range(0,100,5): for stepB in range(0,100,5): ledR.ChangeDutyCycle(stepR) ledG.ChangeDutyCycle(stepG) ledB.ChangeDutyCycle(stepB) time.sleep(0.1) # Whole cycle 8000 times this ledR.ChangeDutyCycle(0) ledG.ChangeDutyCycle(0) ledB.ChangeDutyCycle(0) except KeyboardInterrupt: pass ledR.stop(0) #stop the PWM ledG.stop(0) ledB.stop(0) io.cleanup() # Restore default GPIO state When you walk through this listing, you see that the first thing the code does is set three GPIO pins to be outputs and then set them up to produce a PWM signal. The value 60 in these opening lines of code is the frequency 60 Hz, which is the frequency the PWM signal will go at. The duty cycle goes from 0, which is off all the time, to 100, which is on all the time. The main part of the program consists of three nested for loops, which ensure that all combinations of red, green, and blue are produced in duty cycle steps of five. It takes 800 seconds — just over 13 minutes — to do a complete cycle where 8,000 colors are produced. It might not look like that many colors when you test your LED output running this code, but they are all there. It’s just that many of them from this demonstration might look the same. This has to do with the way people perceive colors — they’re much more sensitive to the difference between two colors than to the colors themselves.

View Article
Raspberry Pi Ready-Made Add-On Boards for Your Raspberry Pi

Article / Updated 11-07-2017

There are basically two types of ready-made boards for the Raspberry Pi: those designed for making it easy to get access to the GPIO pins and those with components that have already been soldered up. Since the introduction of the Raspberry Pi in 2012, many companies have produced ready-made boards with all sorts of components already built on. They normally come with sample code to show you how to use them, and many users just stick to that. However, this can be a wasted opportunity because you can always do more with a board than is shown in these examples. Many of these boards contain sensors that allow your Pi programs to measure things. New boards are constantly being developed and produced. Boards come in three styles: Separate boards that connect to the GPIO pins via a ribbon cable or your own wires. Boards that plug into all the GPIO pins and cover most of the area of the Raspberry Pi board. These are sometimes called shields or plates. Boards similar to the shield/plate variety just mentioned but contain in addition an identification and sometimes software so that the Pi can read what they are on start-up and install some software and prepare the GPIO pins automatically. These are called HATs — short for Hardware Attached on Top. The Sense HAT The Sense HAT was specifically designed for the Astro-Pi mission and two ruggedised versions were flown on the International Space Station from December 2015 running code written by school children. It has an 8×8 RGB LED matrix, a 5-button joystick, and sensors to measure acceleration, magnetism, temperature, pressure, and humidity — as well as a gyroscope. The Sense HAT also has an extensive Python library associated with it, which allows for easy access to this board. You can find comprehensive coverage of how to use the Sense HAT on the Raspberry Pi Foundation's website. The Skywriter HAT The Skywriter HAT is an electric near-field 3D proximity sensor. With it, you can make gestures with your hands waving above it, which can then be detected by the library software, causing your own functions to run. Gestures such as flicks right, left, up, and down can easily be detected along with a circular motion of the finger. It also detects taps made directly to the HAT surface. It has a range of about 5 centimeters and can be mounted behind any nonconducting surface, such as an acrylic sheet. The Xtrinsic Sense board The Xtrinsic Sense board is a low-cost sensor board, in some ways similar to the Sensor HAT but without the LEDs. It is made in partnership with the component distributor and Raspberry Pi co-manufacturer Farnell. It contains a high-precision pressure sensor in the range 50 to 110kPa, a 3-axis, digital accelerometer, and a 3D magnetometer. As you can see, it sits over less than half the Raspberry Pi and can be used, among other things, with robots and high-altitude balloons. Other boards There are many other boards available from small start-up manufacturers as well as web-based projects for you to build. Here’s a good starting point for information on expansion boards.

View Article
page 1
page 2
page 3
page 4

Quick Links

  • About For Dummies
  • Contact Us
  • Activate Online Content

Connect

About Dummies

Dummies has always stood for taking on complex concepts and making them easy to understand. Dummies helps everyone be more knowledgeable and confident in applying what they know. Whether it's to pass that big test, qualify for that big promotion or even master that cooking technique; people who rely on dummies, rely on it to learn the critical skills and relevant information necessary for success.

Copyright @ 2000-2024 by John Wiley & Sons, Inc., or related companies. All rights reserved, including rights for text and data mining and training of artificial technologies or similar technologies.

Terms of Use
Privacy Policy
Cookies Settings
Do Not Sell My Personal Info - CA Only