Hi, I am working a project with BME680 and MKL27 microcontroller. I am trying to get VOC and CO2 values. But the values are not changed also after long time, and also IAQ. I am not sure, but I guess the problem from timestamp. I found some examples of the function. But they are not declared in my program. Can you help me about that or give me some other examples in c? Under the text, I added my log of outputs and timestamp function. The result : 2021-01-06 11:13:06,[Timestamp(88840)],[IAQ (0)]: 25.000000,[T degC]: 28.299999,[H %rH]: 20.97,[P hPa]: 1008.84,[G Ohms]: 13053,[S]: 0,[static IAQ]: 25.00,[eCO2 ppm]: 500.000000000000000,[bVOCe ppm]: 0.4999999403953552246093750 2021-01-06 11:13:10,[Timestamp(88840)],[IAQ (0)]: 25.000000,[T degC]: 28.307171,[H %rH]: 21.15,[P hPa]: 1008.90,[G Ohms]: 7311,[S]: 0,[static IAQ]: 25.00,[eCO2 ppm]: 500.000000000000000,[bVOCe ppm]: 0.4999999403953552246093750 2021-01-06 11:15:04,[Timestamp(88840)],[IAQ (0)]: 25.000000,[T degC]: 28.411655,[H %rH]: 20.38,[P hPa]: 1008.78,[G Ohms]: 7079,[S]: 0,[static IAQ]: 25.00,[eCO2 ppm]: 500.000000000000000,[bVOCe ppm]: 0.4999999403953552246093750 2021-01-06 11:15:05,[Timestamp(88840)],[IAQ (0)]: 25.000000,[T degC]: 29.838865,[H %rH]: 19.25,[P hPa]: 1008.86,[G Ohms]: 8275,[S]: 0,[static IAQ]: 25.00,[eCO2 ppm]: 500.000000000000000,[bVOCe ppm]: 0.4999999403953552246093750 2021-01-06 11:15:07,[Timestamp(88840)],[IAQ (0)]: 25.000000,[T degC]: 28.525309,[H %rH]: 20.44,[P hPa]: 1008.78,[G Ohms]: 9109,[S]: 0,[static IAQ]: 25.00,[eCO2 ppm]: 500.000000000000000,[bVOCe ppm]: 0.4999999403953552246093750 2021-01-06 11:15:10,[Timestamp(88840)],[IAQ (0)]: 25.000000,[T degC]: 28.405308,[H %rH]: 20.41,[P hPa]: 1008.78,[G Ohms]: 10129,[S]: 0,[static IAQ]: 25.00,[eCO2 ppm]: 500.000000000000000,[bVOCe ppm]: 0.4999999403953552246093750 get_timestamp_us function : int64_t get_timestamp_us() { struct timeval tv; uint64_t ret; if(gettimeofday(&tv, NULL) < 0) { printf("gettimeofday() error\r\n"); return -1; } uint64_t millis = (tv.tv_sec) * 1000000 + (tv.tv_usec);//uint64_t millis = (tv.tv_sec) * 1000 + (tv.tv_usec)/1000; return millis; } tv_sec value is for example, 1609930499 and tv_usec 0 or under 0. I see just 0x0. I got the value of millis 662800064. I am not sure, whether it is right.
... View more