Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Intel Galileo Essentials

You're reading from   Intel Galileo Essentials Leverage the power of Intel Galileo to construct amazingly simple, yet impressive projects

Arrow left icon
Product type Paperback
Published in Feb 2015
Publisher
ISBN-13 9781784398903
Length 162 pages
Edition 1st Edition
Tools
Arrow right icon
Toc

Table of Contents (10) Chapters Close

Preface 1. Getting Started with the Galileo FREE CHAPTER 2. Accessing the GPIO Pins 3. Adding Display Functionality 4. Controlling DC Motors 5. Adding Sensors 6. Remote Control 7. Going Further with Galileo 8. Speech Output Index

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)...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image