Thanks @Paul, silly me found it now - but a search for "stoops working when PC turned off" was fruitless.
I checked the issue with this simple sketch on a NODE - and when I turned the PC off it stopped - but restarted. Not sure why that should happen.
I'll need to check it with the ESP32 to see if the issue is with the ESP32 or the code I'm running.
But the ESP32 code DOES run on a USB wall wart so I dont see it can be a serial comms issue.
/*
Read pot on "A0" and short flash LED1
LED is connected to GND via 1k resistor
the only analog input - A0 is on the opposite side to digital io pins.
GPIO pins on the same side as A0 can not be used for digital io
*/
#define LED1 16 //D0
const int analogInPin = A0; // ESP8266 Analog Pin ADC0 = A0
int sensorValue = 0; // value read from the pot
void setup() {
pinMode(LED1, OUTPUT); // LED pin as output.
Serial.begin(57600);
}
void loop() {
sensorValue = analogRead(analogInPin);
Serial.println(sensorValue);
digitalWrite(LED1, HIGH);// turn the LED on.
delay(sensorValue); // wait for sensoeValue" msec
digitalWrite(LED1, LOW); // turn the LED off for 100msec.
delay(100);
}
@chrisknightley - thanks for the link - I found the button, and the "options" in the drop down. Good to know.