Can't set pin mode of GPIO 1
Posted: Sun Oct 01, 2017 2:42 am
Hi guys,
I've been trying to set the GPIO 1 pin mode on my ESP 01S to an output so that I can use it to control a transistor. However, whenever I try to set the pin mode of pin 1 to an output (or even an input) the program won't run.
I can change the pin mode of the GPIO 2 pin and the program will run but as soon as I try to do so with the GPIO 1 pin the program won't run. Here's a snippet of the code (the rest is the code works fine as long as GPIO 1 pin mode isn't set):
Thanks
I've been trying to set the GPIO 1 pin mode on my ESP 01S to an output so that I can use it to control a transistor. However, whenever I try to set the pin mode of pin 1 to an output (or even an input) the program won't run.
I can change the pin mode of the GPIO 2 pin and the program will run but as soon as I try to do so with the GPIO 1 pin the program won't run. Here's a snippet of the code (the rest is the code works fine as long as GPIO 1 pin mode isn't set):
Code: Select all
#include <ESP8266WiFi.h>
const char* ssid = "XXX";
const char* pass = "XXX";
String ID_NUM = "000" ;
String sendStatus ;
IPAddress server(192, 168, 3, 3);
WiFiClient client;
void setup() {
Serial.begin(9600);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
}
Serial.println();
Serial.println("Connected");
Serial.print("LocalIP:"); Serial.println(WiFi.localIP());
Serial.println("MAC:" + WiFi.macAddress());
Serial.print("Gateway:"); Serial.println(WiFi.gatewayIP());
Serial.print("AP MAC:"); Serial.println(WiFi.BSSIDstr());
pinMode(2, INPUT);
pinMode(1, OUTPUT) ; //ADDING THIS CAUSES THE PROGRAM TO NOT RUN
digitalWrite(1, LOW) ; //ADDING THIS CAUSES THE PROGRAM TO NOT RUN
}
Thanks