This example (found in the Adafruit_WICED_Arduino/examples/WiFi folder) will ping the specified servers and display the ping response time(s).

Setup

Set your AP details using the WLAN_SSID and WLAN_PASS flags, setting them to the values used by you own access point:

#define WLAN_SSID            "YOURSSID"
#define WLAN_PASS            "YOURPASSWORD"

By default the sketch will ping adafruit.com and two Google domain name servers (8.8.8.8 and 8.8.4.4).  If you wish to change the server(s) used, simply replace the values assigned in the variables below:

// Ping target by hostname
const char target_hostname[] = "adafruit.com";

// Ping target by IP String
const char target_ip_str[] = "8.8.8.8";

// Ping target by IPAddress object
IPAddress target_ip(8, 8, 4, 4);

Compile and Flash

You can then compile and flash your sketch to the WICED Feather using the 'Download' arrow icon at the top of the IDE:

You should see the USB DFU progress as the update advances, and there will be a 'Done Uploading' message in the top left of the status bar when you are done:

Testing the Sketch

Wait a few seconds for the USB CDC serial interface to enumerate, and then open the Serial Monitor using either the Serial Monitor icon in the upper-right of the IDE or via Tools > Serial Monitor:

This will cause the WICED Feather to attempt to connect to the access point, and then it will attempt to ping the specified server(s):

This guide was first published on Mar 23, 2016. It was last updated on Mar 08, 2024.

This page (Ping) was last updated on Feb 11, 2016.

Text editor powered by tinymce.