Skip to main content

Module sim

Module sim 

Source
Expand description

An SCD40 or SCD41 that is not there.

part answers the way an SCD4x reading 800 ppm at 22.5 C and 45 % does, and reporting at any reading. It answers at the one address the part has, I2C_ADDRESS, and takes Sensirion’s 16-bit commands: the serial number, the data-ready status, which always says a reading is waiting, and the reading itself, each word with its CRC; starting, stopping, and the other commands answer with nothing.

Constants§

CELSIUS
The temperature part reports.
CO2_PPM
The carbon dioxide concentration part reports, in parts per million.
RELATIVE_HUMIDITY
The relative humidity part reports, as a percentage.
SERIAL
The serial number every simulated part reports.

Functions§

part
An SCD4x reading CO2_PPM, CELSIUS, and RELATIVE_HUMIDITY.
reporting
An SCD4x that reads what it is asked to.