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 now! 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
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Arduino Robotic Projects

You're reading from   Arduino Robotic Projects Build awesome and complex robots with the power of Arduino.

Arrow left icon
Product type Paperback
Published in Aug 2014
Publisher
ISBN-13 9781783989829
Length 240 pages
Edition Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Richard Grimmett Richard Grimmett
Author Profile Icon Richard Grimmett
Richard Grimmett
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Arduino Robotic Projects
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Powering on Arduino 2. Getting Started with the Arduino IDE FREE CHAPTER 3. Simple Programming Concepts Using the Arduino IDE 4. Accessing the GPIO Pins 5. Working with Displays 6. Controlling DC Motors 7. Controlling Servos with Arduino 8. Avoiding Obstacles Using Sensors 9. Even More Useful Sensors 10. Going Truly Mobile – the Remote Control of Your Robot 11. Using a GPS Device with Arduino 12. Taking Your Robot to Sea 13. Robots That Can Fly 14. Small Projects with Arduino Index

Accessing the sonar sensor from the Arduino IDE


Now that the HW is connected, you'll want to download a library that supports this sensor. One of the better libraries for this sensor is available at https://code.google.com/p/arduino-new-ping/. Download the NewPing library and then open the Arduino IDE. You can include the library in the IDE by navigating to Sketch | Import Library | Add Library | Downloads and selecting the NewPing ZIP file. Once you have the library installed, you can access the example program by navigating to File | Examples | NewPing | NewPingExample as shown in the following screenshot:

You will then see the following code in the IDE:

Now, upload the code to Arduino and open a serial terminal by navigating to Tools | Serial Monitor in the IDE. Initially, you will see characters that make no sense; you need to change the serial port baud rate to 115200 baud by selecting this field in the lower-right corner of Serial Monitor, as shown in the following screenshot:

Now...

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