So when I write a sketch to my ESP 8266 and open up the serial monitor I get the watchdog timer reset error:
ets Jan 8 2013 ,rst cause:4,boot mode:(3,6)
load 0X4010f000
tail 4
chksum 0xcc
load 0x3fff20b8, len 3460,room16
tail 4
chksum 0xc9
csum 0xc9
v00042260
~1d
If I run the same sketch on a Arduino Nano the sketch works in the serial monitor. Just to be clear here I was just too lazy to change boards and trying to brush up on coding , sort of testing myself writing several programs and getting them to work. Here is the sketch, basically it asks what color led do you want to light. INMHO you for the most part should be able to load basic sketches in either ESP8266 or Arduino short of WiFi communicating. Also if I run a basic WiFi sketch it loads and runs fine on the 8266 ie;WiFi Scan
Start your code here
[code]
int redLed = 4;
int yellowLed = 5;
int greenLed = 6;
String myColor;
String msg = “What color led do you want?”;
int dt = 100;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(redLed, OUTPUT);
pinMode(yellowLed, OUTPUT);
pinMode(greenLed, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println(msg);
while (Serial.available() == 0); {
}
myColor = Serial.parseInt();
if (myColor == ” red “) {
digitalWrite(redLed, HIGH);
digitalWrite(yellowLed, LOW);
digitalWrite(greenLed, LOW);
delay(dt);
}
if (myColor == “green “) {
digitalWrite(redLed, LOW);
digitalWrite(yellowLed, LOW);
digitalWrite(greenLed, HIGH);
delay(dt);
}
if (myColor == ” yellow “) {
digitalWrite(redLed, LOW);
digitalWrite(yellowLed, HIGH);
digitalWrite(greenLed, LOW);
delay(dt);
}
}
[/code]
Hi.
The problem is probably because there isn’t an available GPIO 6 on the ESP8266 board.
Change that pin, and it should be fine.
For more information, you can check the ESP8266 pinout guide: https://randomnerdtutorials.com/esp8266-pinout-reference-gpios/
Regards,
Sara
Wow, didn’t even notice that, thanks.Just I was writing this code that I would just use them in order not really checking if they were even there, assumed it was valid.