void setup() {
Serial.begin(115200);
Serial.println("here 0");
pinMode(6, INPUT);
Serial.println("here 1");
pinMode(6, OUTPUT);
Serial.println("here 2");
pinMode(6, INPUT_PULLUP);
Serial.println("here 3");
}
void loop() {
// Do nothing
}
And getting the following output:
⸮here 0
here 1
ets Jan 8 2013,rst cause:4, boot mode:(3,6)
wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v180000ca
~ld
This repeats every (approx) 6 seconds. Changing the 6s to 5s fixes the problem (except that I need to use pin 6).
My understanding is that setting the pinMode to OUTPUT is hanging, and the hardware watchdog is rebooting the device. But how can setting the pinMode hang?
Thanks!