To connect the Arduino GPS shield with the Arduino Ethernet board, perform the following steps:
Follow these steps to test the GPS shield:
B04844_06_01.ino
from the Chapter 6
code folder of this book. (Note that this is the sample code included with the TinyGPSPlus library to display the current location by latitude and longitude with date and time). You can also open this sketch by navigating to File | Examples | TinyGPSPlus | DeviceExample on the menu bar.In each entry, the current location is displayed with latitude, longitude, and date/time. Next, you will learn how to use these values to display the location on Google Maps.
Google Maps JavaScript API can be used to display the current location with a marker on Google Maps. We can simply pass the latitude and longitude to the Google JavaScript API library and display the current location as a simple marker.
The following steps will explain you how to display the Arduino GPS shield's current location on Google Maps:
B04844_06_02.ino
from the Chapter 6
code folder. Verify and upload the sketch to your Arduino Ethernet Shield or Arduino Ethernet board.var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
The latitude and longitude values should be replaced with the real time returning values of the Arduino GPS shield as follows:
var myLatlng = new google.maps.LatLng(gps.location.lat(),gps.location.lng());
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
http://192.168.10.177
.In the next section, you will learn how to send the current GPS location by SMS to the client using Twilio and Temboo.
3.12.123.2