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
Internet of Things with Arduino Cookbook

You're reading from   Internet of Things with Arduino Cookbook Build exciting IoT projects using the Arduino platform

Arrow left icon
Product type Paperback
Published in Sep 2016
Publisher Packt
ISBN-13 9781785286582
Length 188 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Marco Schwartz Marco Schwartz
Author Profile Icon Marco Schwartz
Marco Schwartz
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Connecting an Arduino to the Web FREE CHAPTER 2. Cloud Data Monitoring 3. Interacting with Web Services 4. Machine-to-Machine Interactions 5. Home Automation Projects 6. Fun Internet of Things Projects 7. Mobile Robot Applications Index

Basic robot control


In this recipe, we are finally going to dive into the core of this chapter: making our robot move around! We'll learn how to configure it so it can receive commands via Wi-Fi, and then we'll learn how to control it using a simple interface running inside your browser.

Getting ready

For this recipe, just make sure that you followed all the recipes so far in the chapter. Also, it is recommended to leave the robot in a position where the wheels or track are not touching the ground, at least till you are sure it is working correctly.

How to do it...

We are now going to program the robot so it accepts commands via Wi-Fi. For that, we'll use the aREST framework that we have already used several times in this book.

The sketch starts by including the required libraries:

#include <SPI.h>
#include <WiFi101.h>
#include <aREST.h>

Then, you need to define your Wi-Fi network name and password:

char ssid[] = "wifi-name';
char password[] = "wifi-pass';

After that, we declare...

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