Interfacing with CO2 sensor settings via serial communication

Hello,

I would like to make some adjustments on my CO2 sensor’s filter settings. On the sensor manual, the command for the sensor to return the current digital filter setting is given as “a\r\n” ("\r\n" stands for carriage return and line change). This is the code I have so far:

#include<SoftwareSerial.h>

SoftwareSerial mySerial(5,6); // TX, RX

void setup() {
    Serial.begin(9600);
    Serial.println("<Arduino is ready>");
    mySerial.begin(9600); //start serial connection with Sensor
}

void loop() {
    delay(1000);
    mySerial.println("a");
}

According to my code, I would like the sensor to output the current digital filter setting every second. The question is how I can view the result given by the sensor. The serial monitor on Arduino only shows “Arduino is ready”. Is there a way that I can see a monitor from ‘myserial’? Thanks.

think this way in loop()

int c = mySerial.read(); // if available...

Serial.println(c);

const unsigned long requestInterval = 1000; //milliseconds = how often to send the "a" to the sensor
#include<SoftwareSerial.h>

SoftwareSerial mySerial(5,6); // TX, RX

void setup() {
    Serial.begin(9600);
    Serial.println("<Arduino is ready>");
    mySerial.begin(9600); //start serial connection with Sensor
}

void loop() {
    static unsigned long lastCO2Request = 0;
    if(millis() - lastCO2Request > requestInterval) {
      mySerial.println("a");
      lastCO2Request = millis();
    }

    if(mySerial.available()) Serial.write(mySerial.read()); //copies all incoming data from mySerial to the computer/USB serial
}