void setup() {
// put your setup code here, to run once:
Serial.begin(9600); // Initialize the serial communication
pinMode(7, INPUT);
}
void loop() {
int pinState = digitalRead(7); // Read the state of the pin
if (pinState == HIGH) {
Serial.println("Pin is HIGH"); // Print a message if the pin is HIGH
} else {
Serial.println("Pin is LOW"); // Print a message if the pin is LOW
}
delay(2000);
}
void setup() {
// put your setup code here, to run once:
Serial.begin(115200); // Initialize the serial communication
pinMode(14, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(14, HIGH);
Serial.println("Pin is HIGH"); // Print a message if the pin is HIGH
delay(2000);
digitalWrite(14, LOW);
Serial.println("Pin is LOW"); // Print a message if the pin is LOW
delay(2000);
}
ESP8266 |
Arduino uno |
Vin |
5V |
GND |
GND |
14 |
7 |