There are already answers about how to get BSEQ IAQ values by increasing SENSOR_DATA_FIXED_LENGTH in SensorTypes.h.
Unfortunately this only works for the LEGACY ID (115) and only for IAQ but not for the current one (171).
Is there any update on how to get the BSEQ data working with all values (including CO2)?
Here's the code i am using with the latest Arduino_BHY2 library (1.0.6):
#include "Arduino.h"
#include "Arduino_BHY2.h"
Sensor gas(SENSOR_ID_GAS);
SensorBSEC bsec(SENSOR_ID_BSEC); //_LEGACY);
void setup() {
Serial.begin(115200);
while (!Serial)
;
BHY2.begin();
gas.begin();
bsec.begin();
}
void loop() {
static auto printTime = millis();
// Update function should be continuously polled
BHY2.update();
if (millis() - printTime >= 1000) {
printTime = millis();
Serial.println(String("gas: ") + String(gas.value(), 3));
Serial.println(String("bseq: ") + String(bsec.toString()));
}
}
Console output:
14:54:58.375 -> gas: 10121.000
14:54:58.375 -> bseq: BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0
14:54:58.407 ->
14:54:59.398 -> gas: 10273.000
14:54:59.398 -> bseq: BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0
14:54:59.398 ->