Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include <WiFi.h>
  2.  
  3. char ssid[] = "yourNetwork"; // your network SSID (name)
  4. char pass[] = "12345678"; // your network password
  5. int status = WL_IDLE_STATUS; // the Wifi radio's status
  6.  
  7. void setup() {
  8. // initialize serial:
  9. Serial.begin(9600);
  10.  
  11. // attempt to connect using WPA2 encryption:
  12. Serial.println("Attempting to connect to WPA network...");
  13. status = WiFi.begin(ssid, pass);
  14.  
  15. // if you're not connected, stop here:
  16. if ( status != WL_CONNECTED) {
  17. Serial.println("Couldn't get a wifi connection");
  18. while(true);
  19. }
  20. // if you are connected, print out info about the connection:
  21. else {
  22. Serial.println("Connected to network");
  23. }
  24. }
  25.  
  26. void loop() {
  27. // do nothing
  28. }