Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Intel Galileo Blueprints
  • Table Of Contents Toc
Intel Galileo Blueprints

Intel Galileo Blueprints

By : Marco Schwartz
5 (1)
close
close
Intel Galileo Blueprints

Intel Galileo Blueprints

5 (1)
By: Marco Schwartz

Overview of this book

If you are an experienced developer using classic Arduino boards and would like to extend your knowledge to the Intel Galileo board and polish your project building skills, this book is for you.
Table of Contents (14 chapters)
close
close
Lock Free Chapter
1
1. Setting Up the Galileo Board and the Development Environment
13
Index

Using the relay controller

Now that we have assembled the relay controller, we will build the Arduino sketch to make the circuit do as we like. We will create the sketch in such a way that it will be able to control the relay through the push button. To do so, you will need to follow the code given in these steps:

  1. First, we will declare the relay and the button pins. The relay is pin 7, while the button is pin 8. To do this, follow the code:
    int relayPin = 7;
    int buttonPin = 8;
  2. Next, we will create variables for the button states:
    int buttonState;
    int lastButtonState = LOW;   
    int previousButtonState = LOW;
  3. To debounce the button and achieve a stable state for the relay, we will add the following code. We will declare a default last debounce time and debounce delay:
    long lastDebounceTime = 0;
    long debounceDelay = 50;
  4. Then, we will create a variable for the state of the relay:
    int relayState = LOW;

    Inside the setup() function of the sketch, we will set the pins for the relay and the button. The button...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Intel Galileo Blueprints
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon