O'Reilly logo

Arduino Networking by Marco Schwartz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a web server on Arduino

For the rest of this chapter, we are going to take another approach. We are still going to make the Arduino with the Ethernet Shield work as an independent system, but this time we are even going to create a web server on the Arduino board. This is actually similar to the project we saw in the Chapter 2, Sending Data to a Web Server, but this time it is the Arduino board itself that will display the data as it is measured.

The sketch for this part starts by including the right libraries, as shown in the following code:

#include "DHT.h"
#include <Ethernet.h>
#include <SPI.h>

Define the pin and the type of the sensor in the following manner:

#define DHTPIN 7
#define DHTTYPE DHT11

Also, you have to define the MAC address ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required