Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
1.4 kB
2
Indexable
Never
/*
   Board: DOIT ESP32 DEVKIT V1
*/
#include <WiFi.h>

#define LED 2

#define WIFISSID "B6-LAB703" // Your WiFi Name
#define PASSWORD "" // Your WiFi Password

void setup() {
  // Initializing Serial communication.
  Serial.begin(9600);
  Serial.println("Init... T1_Intro");
  
  // initialize digital pin LED as an output.
  pinMode(LED, OUTPUT);

  // Setup up WiFi and Connecting to an active hotspot.
  Serial.print("\n\nCnonnecting to ");
  Serial.println(WIFISSID);

  WiFi.begin(WIFISSID, PASSWORD);
  while (WiFi.status() != WL_CONNECTED) { // Waiting for successful connection
        delay(500);
        Serial.print(".");
  }

  Serial.print("\nRSSI: ");
  Serial.println(WiFi.RSSI());
  
  Serial.print("WiFi connected. IP address: ");
  Serial.println(WiFi.localIP());
  
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED, HIGH);   // turn the LED on (HIGH is the voltage level)
  //Serial.println("HIGH");
  delay(600);                       // wait for a second
  digitalWrite(LED, LOW);    // turn the LED off by making the voltage LOW
  //Serial.println("LOW");
  delay(600);                       // wait for a second

  Serial.print("\nRSSI: ");
  Serial.println(WiFi.RSSI());
  
  Serial.print("WiFi connected. IP address: ");
  Serial.println(WiFi.localIP());
}