Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Intel Galileo Essentials
Intel Galileo Essentials

Intel Galileo Essentials: Leverage the power of Intel Galileo to construct amazingly simple, yet impressive projects

Arrow left icon
Profile Icon Richard Grimmett
Arrow right icon
€8.99 €19.99
eBook Feb 2015 162 pages 1st Edition
eBook
€8.99 €19.99
Paperback
€24.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Richard Grimmett
Arrow right icon
€8.99 €19.99
eBook Feb 2015 162 pages 1st Edition
eBook
€8.99 €19.99
Paperback
€24.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€8.99 €19.99
Paperback
€24.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Intel Galileo Essentials

Chapter 2. Accessing the GPIO Pins

Now that you are familiar with the Galileo IDE and know how to create, edit, and upload a program, this chapter will now focus on hardware. You'll learn about the capabilities of the General Purpose Input/Output (GPIO) pins and how you can connect to and access them via software. Specifically, you'll learn about the following:

  • The GPIO pins, what they can and can't do
  • How to use and access them using some very basic circuits and very simple programming examples that demonstrate how to make the Galileo access the outside world

The GPIO capability of the Galileo

The Galileo was built to model how the Arduino accesses the outside world. Much of that access should be through the GPIO pins. The Galileo comes with a standard set of 14 digital and 6 analog IO pins, along with some additional pins to provide power and serial IO. Fortunately, the pins are actually well labeled on the board itself.

Here is a close-up:

The GPIO capability of the Galileo

Here is a list of pins that are available, and a brief description of what each pin can do, starting at the upper right and going clockwise. A more in-depth description of these pins will come later as you actually use them in some example projects:

Galileo Pin

Description

AREF

This pin provides a reference voltage for the analog inputs. The values on the analog pins will be reported in reference to this voltage. You'll also use this in some applications to provide a reference voltage for sensing devices. You can also provide an external reference value to this pin, which means that the numerical...

Using the GPIO pins

Now that you are aware of all the GPIO capabilities, you can start putting them to work. In order to do this, it is best to purchase a small breadboard and some jumper wires; this will make connecting to the outside world easier. Here is a picture of such a breadboard:

Using the GPIO pins

They are easy to find, you can purchase one at almost any electronics store, or on any electronic online sites. You'll need some jumper wires to connect from the Galileo to the breadboard. The jumper wires you want are the Male-to-Male solder-less jumper wires. Here is a picture of this sort of wire:

Using the GPIO pins

These jumper cables plug easily into the header pins on the Galileo and the breadboard. Now that you have the cables and the breadboard, you can start accessing and controlling hardware.

Connecting your first external hardware

Your first project will use the Digital IO pins to light up an LED. To do this, you'll need to gather two more hardware pieces. The first is an LED (Light Emitting Diode). This is a small part with two leads that lights up when voltage is applied. They come in a wide variety of colors. If you want to buy them online, search for a 3-mm LED. You can also get them at most electronics shops. The image shows an LED:

Connecting your first external hardware

You'll also need a resistor to limit the current to the LED; a 220-ohm resister would be the right size. Again, you can get them online or at most electronics shops. The following image shows a resistor:

Connecting your first external hardware

If you get three LEDs and resistors, you can exercise three of the Digital IO pins.

Plugging your wires into the breadboard

Now that you have all the bits and bobs, let's build your first hardware project. Before you plug anything in, let's look at the breadboard for a moment so that you can understand how you are going to use...

The IDE and LED Code

To create the code for this example, start the Galileo IDE. Recall the Blink example you accessed in Chapter 1, Getting Started with the Galileo. The IDE should look like this:

The IDE and LED Code

If you remember this code, int led = 13 lit the orange LED on the board. It turns out that LED output pin 13 is also the connection to the 13 pin on the Galileo connector. If you upload and run this program, the LED connected to pin 13 should flash at the same rate as the LED on the Galileo. Here is a picture:

The IDE and LED Code

You'll need to add a similar bit of code to get the LEDs connected to pin 12 and 11. Add the following to the sketch on the IDE:

The IDE and LED Code

Here, you are replicating the code but connecting the LED connected to pin 13 to the variable led, the LED connected to pin 12 to the variable led1, and the LED connected to pin 13 to the variable led3. You then program them all to be output pins and then in the main loop toggle between high and low. Notice I have two pins toggling together (pins 13 and 11)...

Getting signals from the outside world

You know how to send signals to the outside world. You might also want to receive input signals from the outside world. These signals can be divided into two types: digital signals and analog signals.

Interfacing digital input signals with Galileo

There are pins on the GPIO connectors of the Galileo than can be used to sense digital input; that is, an input that will be interpreted as either a 0 or 1 by a program. These are labelled on the Galileo. An example of how to use these is a simple button press circuit. To create this circuit, you'll need one of the 220-ohm resistors you used in the LED circuit. You'll also need a simple, single-pole, single-throw switch; you can get these at most electronics stores. You'll also need some jumper wires to connect the Galileo to your circuit. Here is the circuit diagram:

Interfacing digital input signals with Galileo

Now you'll need some code. You can use one of the example programs included with the IDE. Select the Examples | 02.Digital...

The GPIO capability of the Galileo


The Galileo was built to model how the Arduino accesses the outside world. Much of that access should be through the GPIO pins. The Galileo comes with a standard set of 14 digital and 6 analog IO pins, along with some additional pins to provide power and serial IO. Fortunately, the pins are actually well labeled on the board itself.

Here is a close-up:

Here is a list of pins that are available, and a brief description of what each pin can do, starting at the upper right and going clockwise. A more in-depth description of these pins will come later as you actually use them in some example projects:

Galileo Pin

Description

AREF

This pin provides a reference voltage for the analog inputs. The values on the analog pins will be reported in reference to this voltage. You'll also use this in some applications to provide a reference voltage for sensing devices. You can also provide an external reference value to this pin, which means that the numerical values...

Left arrow icon Right arrow icon

Description

This book is for anyone who has ever been curious about using the Intel Galileo to create electronics projects. Some programming background is useful, but if you know how to use a personal computer, with the aid of the step-by-step instructions in this book, you can construct complex electronics projects that use the Intel Galileo.

Who is this book for?

This book is for anyone who has ever been curious about using the Intel Galileo to create electronics projects. Some programming background is useful, but if you know how to use a personal computer, with the aid of the step-by-step instructions in this book, you can construct complex electronics projects that use the Intel Galileo.

What you will learn

  • Access the Linux system that is the basis for Galileo to add even more complex hardware and software
  • Install and use the software development environment and connect to the Galileo and develop programs for it
  • Add a simple display to the Galileo
  • Connect external HW to the GPIO pins
  • Control DC motors with the Galileo
  • Add sensors to a Galileobased project
  • Access your Galileo wirelessly
  • Understand the basics of sketches, include files, and HW support

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Feb 24, 2015
Length: 162 pages
Edition : 1st
Language : English
ISBN-13 : 9781784390167
Vendor :
Intel
Category :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Feb 24, 2015
Length: 162 pages
Edition : 1st
Language : English
ISBN-13 : 9781784390167
Vendor :
Intel
Category :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 74.97
Home Automation with Intel Galileo
€24.99
Intel Galileo Essentials
€24.99
Internet of things with Intel Galileo
€24.99
Total 74.97 Stars icon
Banner background image

Table of Contents

9 Chapters
1. Getting Started with the Galileo Chevron down icon Chevron up icon
2. Accessing the GPIO Pins Chevron down icon Chevron up icon
3. Adding Display Functionality Chevron down icon Chevron up icon
4. Controlling DC Motors Chevron down icon Chevron up icon
5. Adding Sensors Chevron down icon Chevron up icon
6. Remote Control Chevron down icon Chevron up icon
7. Going Further with Galileo Chevron down icon Chevron up icon
8. Speech Output Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.