Arduino serial monitor reset

void setup() {
  Serial.begin(115200);
  analogWriteResolution(12);
  analogReadResolution(16);

}


void loop() {
  int fsr_value = analogRead(A5);
  Serial.println(fsr_value);
}

Hello, I am using arduion portenta h7 for reading the sensor data at A5 pin
My question is that it read the sensor data and print on serial monitor correctly.

But after I turn on and off the serial monitor the sensor data becomes 0. So nothing is print on the serial monitor. How Can I deal with this issue.

I found that arduion restart the board if they try to reconnect to serialmonitor. But why the sensor data become 0. Aslo the concept about epprom(memory) something.. but I am not sure how to use it.

So what I want to do is get the sensor data continuously after I reconnect to serial monitor. Sensor data will be change every time

Thank you !

you may need a delay in your loop.
your present code will repeat very quickly.

1 Like