Skip to Content
ESP8266 Internet of Things Cookbook
book

ESP8266 Internet of Things Cookbook

by Marco Schwartz
April 2017
Intermediate to advanced
268 pages
5h 36m
English
Packt Publishing
Content preview from ESP8266 Internet of Things Cookbook

Reading analog signals

The ESP8266 has one analog pin that we can use to read analog signals. In this recipe, we will be looking at how to write a sketch that reads analog signals. This will enable us to read input from analog sensors.

Getting ready

Connect your ESP8266 board to your computer via a USB cable and set up your Arduino IDE (refer back to Chapter 1, Configuring the ESP8266). Once that is done, you can proceed to make the other connections.

In this recipe, we will need a breadboard and jumper wires in addition to the ESP8266 board. Mount the ESP8266 board onto the breadboard and then connect a jumper wire from the analog ADC pin to the GND pin. The connection should be as shown in the following diagram:

How to do it…

We will use the analogRead() ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Internet of Things with ESP8266

Internet of Things with ESP8266

Marco Schwartz
ESP8266 Robotics Projects

ESP8266 Robotics Projects

Pradeeka Seneviratne

Publisher Resources

ISBN: 9781787288102Supplemental Content