You are on page 1of 1

// Import required libraries

#include <ESP8266WiFi.h>

void setup(void)
{
// Start Serial (to display results on the Serial monitor)
Serial.begin(115200);

// Set GPIO 5 as input


pinMode(5, INPUT);}
void loop() {

// Read GPIO 5 and print it on Serial port


Serial.print("State of GPIO 5: ");
Serial.println(digitalRead(5));

// Wait 1 second
delay(1000);
}

You might also like