Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Arduino for Kids

You're reading from   Arduino for Kids A cool guide to help kids develop robots and electronics

Arrow left icon
Product type Paperback
Published in Mar 2017
Publisher Packt
ISBN-13 9781785884818
Length 218 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Authors (3):
Arrow left icon
Rishi Gaurav Bhatnagar Rishi Gaurav Bhatnagar
Author Profile Icon Rishi Gaurav Bhatnagar
Rishi Gaurav Bhatnagar
Priya Kuber Priya Kuber
Author Profile Icon Priya Kuber
Priya Kuber
Vijay Varada Vijay Varada
Author Profile Icon Vijay Varada
Vijay Varada
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. The World around Us FREE CHAPTER 2. Systems and Logic 3. Components and Connections 4. The Magic Wand 5. Hello World! 6. Safety Box 7. Make a Friend 8. Save Energy 9. High 5! 10. Plant, Meet Arduino!

Digging deep into Arduino libraries


We had discussed functions in the The working section of Chapter 6, Safety Box. If you would have thought that we will need to write our own function for getting the distance using our sensor, you would have been right, if it wasn't for, drum roll please....

Libraries!!

An Arduino library is a file that is a package of functions and declarations for other programs to use. Since we need to use the ultrasonic proximity sensor, instead of implementing the math ourselves, and writing our own functions, we can use the <Ultrasonic Distance Library>, which has the functions required to calculate and work with the distance sensor.

Downloading and installing an Arduino Library

To download and install the Arduino library, you must follow the following instructions:

  1. For this project, you may download the library from:

    http://playground.arduino.cc/Code/NewPing

  2. To install the library, put the NewPing folder in libraries.

  3. In the Arduino IDE, create a new sketch (or...

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