Hardware Reference
In-Depth Information
en0:
flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST>
mtu 1500
ether b8:f6:b1:12:c4:d7
inet6 fe80::baf6:b1ff:fe12:c4d7%en0 prefixlen 64 scopeid
0x4
inet 192.168.1.100 netmask 0xffffff00 broadcast
192.168.1.255
nd6 options=1<PERFORMNUD>
media: autoselect
status: active
Some Linux distributions made the move to another tool called ip . To use it, simply go to
a terminal and type:
ip addr
This will also display your computer's IP address.
We are now ready to build the Arduino sketch. First, we need to include the required lib-
raries:
#include <SPI.h>
#include <Ethernet.h>
#include "DHT.h"
Insert the MAC address of your Ethernet shield, which you can find on the back of the
shield:
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0E, 0xFE, 0x40 };
You will also need to define the pin on which the DHT sensor was connected, as well as
the type of sensor you are using:
#define DHTPIN 7
#define DHTTYPE DHT11
Note that you do not need a sensor connected to your Arduino board to test this project.
You can simply send the content of any variable as a test, or use the random() function
of Arduino to generate random data measurements.
Search WWH ::




Custom Search