mirror of
https://github.com/digistump/DigistumpArduino.git
synced 2025-09-18 01:42:26 -07:00
switch to setup for Arduino Boards Manager
This commit is contained in:
33
digistump-sam/libraries/DigiFi/examples/ping/ping.ino
Normal file
33
digistump-sam/libraries/DigiFi/examples/ping/ping.ino
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <DigiFi.h>
|
||||
DigiFi wifi;
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(9600);
|
||||
wifi.begin(9600);
|
||||
|
||||
//DigiX trick - since we are on serial over USB wait for character to be entered in serial terminal
|
||||
while(!Serial.available()){
|
||||
Serial.println("Enter any key to begin");
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
Serial.println("Starting");
|
||||
|
||||
while (wifi.ready() != 1)
|
||||
{
|
||||
Serial.println("Error connecting to network");
|
||||
delay(15000);
|
||||
}
|
||||
|
||||
Serial.println("Connected to wifi!");
|
||||
wifi.startATMode();
|
||||
Serial.println(wifi.ping("192.168.2.1"));
|
||||
wifi.endATMode();
|
||||
wifi.close();
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
|
||||
}
|
Reference in New Issue
Block a user