Paul Denisov
Published © GPL3+

Spartan WiFi Pager System

Simple Wifi pager system.

BeginnerWork in progress1 hour3,011
Spartan WiFi Pager System

Things used in this project

Story

Read more

Code

mkr1000_wifi_pager_s1

C/C++
#include <WiFi101.h>
#include <WiFiClient.h>
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(0, 1, 2, 3, 4, 5);

char ssid[] = "mkrTestSSID";
char pass[] = "m4rSSIDpa$$";

int status = WL_IDLE_STATUS;

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);

  if (WiFi.status() == WL_NO_SHIELD) {
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.println("NOT PRESENT");
    return; // don't continue
  }
  
  while ( status != WL_CONNECTED) {
    // Connecting message
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("WiFi network");
    lcd.setCursor(0, 1);
    lcd.print("Connecting ...");

    // Connect to WPA/WPA2 network.
    status = WiFi.begin(ssid, pass);
    // wait 10 seconds for connection:
    delay(10000);
  }

  printWifiStatus(); // Connected status output
}

void printWifiStatus() {
  // print the SSID of the network you're attached to:
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("SSID: ");
  lcd.print(WiFi.SSID());

  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  lcd.setCursor(0, 1);
  lcd.print("IP: ");
  lcd.print(ip);
}


void loop() {
  /* Place for Azure connection code */
  //lcd.clear();
}

Credits

Paul Denisov

Paul Denisov

1 project • 1 follower

Comments