Hardware Reference
In-Depth Information
delay(10000);
Note
All the code for this section can be found inside the GitHub repository of this chapter at
https://github.com/openhomeautomation/arduino-networking/tree/master/chapter3 .
It's now time to test this sketch. Make sure that the Ethernet cable is plugged into the
shield and your Internet router, and the SD card is plugged into the Ethernet shield SD
card slot. You can now upload the sketch to the board and open the Serial Monitor. The
following line is what you should see first:
Initializing SD card...card initialized.
Then, you should see that your Ethernet shield has an IP address, as shown in the follow-
ing line:
IP number assigned by DHCP is 192.168.1.103
You should see that this shield is currently synchronizing the time with the NTP server, as
shown in the following output:
waiting for sync
Transmit NTP Request
Receive NTP Response
After that, you should see that the first measurement is made as follows:
21/5/2014 9:32:13,22,38
After the delay you fixed in the sketch, you will see that a second measurement is made
with the corresponding date and time. To be sure that the sketch is correctly writing data
on the SD card, you can let it run for a while and then disconnect the Ethernet shield from
the power supply. After this, remove the SD card, and read it on your computer via an ad-
apter. You should see the following screenshot:
Search WWH ::




Custom Search