- #include <ESP8266WiFi.h>
- int deng = 14;
- int LED = 2;
- void setup() {
- Serial.begin(9600);
- // pinMode(LED, OUTPUT);
- pinMode(deng,OUTPUT);
- digitalWrite(LED, HIGH);
- WiFi.mode(WIFI_AP);
- WiFi.softAP("AP_ESP8266", "Qq16830168.");
- // Initialize the LED_BUILTIN pin as an output
- }
- // the loop function runs over and over again forever
- void loop() {
- // digitalWrite(LED, LOW);
- // digitalWrite(deng, LOW);
- // Serial.println(digitalRead(deng));
- // Turn the LED on (Note that LOW is the voltage level
- // but actually the LED is on; this is because
- // it is active low on the ESP-01)
- // delay(1000); // Wait for a second
- // digitalWrite(LED, HIGH);
- digitalWrite(deng, 1);
- Serial.println(digitalRead(deng));
- // Turn the LED off by making the voltage HIGH
- delay(2000); // Wait for two seconds (to demonstrate the active low LED)
- }
复制代码
还是不行 |