Still my first project to make a self powered temperature monitor. I have a SHTC3 and 2 TMP102 sensors working to record data and send results to an ADAFRUIT FEATHER SD and RTC card. All worked fine until I tried to unplug USB and run off a battery. First, everything quit until I stopped any SerialPrint calls in the LOOP. I even put a serial.end() call at the end of SETUP.
At this point, at least the sketch restarted at time zero, but obviously recorded no data while unplugged from the USB. Last try was to comment out any serial.print calls in setup, even the Serial.begin(9600) call.
The following call:
#ifndef ESP8266
while (!Serial); // wait for serial port to connect. Needed for native USB
is still in the sketch because it looked important. I this my mistake?
Now the sketch continues to run while unplugged, but none of the sensors provide meaningful readings. SHTC3 gives 0.0 Humidity and -49 temp., while the TMP102’s say nan.
I am sure there is a simple explanation for this behavior, since I am not the first person to try to record data while unplugged from USB. However, I tried, unsuccessfully, to find a similar topic in this forum.
Thanks for any help. Rudy