### Example and Test Target Configuration Source: https://github.com/bolderflight/ms4525do/blob/main/CMakeLists.txt Sets up an executable target 'ms4525do_example' for running examples and tests. This block is conditional on the project name matching the CMAKE_PROJECT_NAME. ```cmake if (PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME) add_executable(ms4525do_example examples/cmake/ms4525do_example.cc) target_include_directories(ms4525do_example PUBLIC $ $ ) target_link_libraries(ms4525do_example PRIVATE ms4525do ) include(${mcu_support_SOURCE_DIR}/cmake/flash_mcu.cmake) FlashMcu(ms4525do_example ${MCU} ${mcu_support_SOURCE_DIR}) endif() ``` -------------------------------- ### Project Setup and Dependency Fetching Source: https://github.com/bolderflight/ms4525do/blob/main/CMakeLists.txt Sets the minimum CMake version and fetches the 'mcu-support' and 'core' libraries using FetchContent. This is essential for the project's build environment. ```cmake cmake_minimum_required(VERSION 3.14) if (DEFINED MCU) include(FetchContent) FetchContent_Declare( mcu_support GIT_REPOSITORY https://github.com/bolderflight/mcu-support.git GIT_TAG v1.1.0 ) FetchContent_MakeAvailable(mcu_support) set(CMAKE_TOOLCHAIN_FILE "${mcu_support_SOURCE_DIR}/cmake/cortex.cmake") project(Ms4525do VERSION 1.1.3 DESCRIPTION "MS4525DO sensor driver" LANGUAGES CXX ) include(${mcu_support_SOURCE_DIR}/cmake/config_mcu.cmake) configMcu(${MCU} ${mcu_support_SOURCE_DIR}) FetchContent_Declare( core GIT_REPOSITORY https://github.com/bolderflight/core.git GIT_TAG v3.1.3 ) FetchContent_MakeAvailable(core) endif() ``` -------------------------------- ### Include Directory Setup Source: https://github.com/bolderflight/ms4525do/blob/main/CMakeLists.txt Configures the include directories for the 'ms4525do' library. It specifies build-time and install-time include paths. ```cmake target_include_directories(ms4525do PUBLIC $ $ ) ``` -------------------------------- ### CMake Integration for Ms4525do Source: https://context7.com/bolderflight/ms4525do/llms.txt Integrates the Ms4525do library into an embedded CMake project using `FetchContent`. This example demonstrates fetching both `mcu-support` and `ms4525do` from GitHub and linking them to the main application. ```cmake cmake_minimum_required(VERSION 3.14) include(FetchContent) # Fetch MCU support toolchain FetchContent_Declare( mcu_support GIT_REPOSITORY https://github.com/bolderflight/mcu-support.git GIT_TAG v1.1.0 ) FetchContent_MakeAvailable(mcu_support) set(CMAKE_TOOLCHAIN_FILE "${mcu_support_SOURCE_DIR}/cmake/cortex.cmake") project(MyProject VERSION 1.0 LANGUAGES CXX) include(${mcu_support_SOURCE_DIR}/cmake/config_mcu.cmake) configMcu(${MCU} ${mcu_support_SOURCE_DIR}) # Fetch ms4525do library FetchContent_Declare( ms4525do GIT_REPOSITORY https://github.com/bolderflight/ms4525do.git GIT_TAG v1.1.3 ) FetchContent_MakeAvailable(ms4525do) add_executable(my_app main.cc) target_link_libraries(my_app PRIVATE ms4525do) # Build from a 'build/' directory: # cmake .. -DMCU=MK66FX1M0 # make # make my_app_upload (to flash via Teensy CLI) ``` -------------------------------- ### Build Ms4525do Library with CMake Source: https://github.com/bolderflight/ms4525do/blob/main/README.md Compile the Ms4525do library as a standalone component using CMake. This command builds the library and an example executable, specifying the target microcontroller. ```bash cmake .. -DMCU=MK66FX1M0 make ``` -------------------------------- ### Get Pressure in Pascals Source: https://github.com/bolderflight/ms4525do/blob/main/README.md Retrieve the pressure data from the sensor in Pascals (Pa). ```C++ float pressure = pres.pres_pa(); ``` -------------------------------- ### Get Die Temperature in Celsius Source: https://github.com/bolderflight/ms4525do/blob/main/README.md Retrieve the internal die temperature of the sensor in degrees Celsius. ```C++ float temperature = pres.die_temp_c(); ``` -------------------------------- ### pres_pa() - Get Pressure in Pascals Source: https://context7.com/bolderflight/ms4525do/llms.txt Returns the most recently decoded pressure value in Pascals (Pa) as a float. This value is only valid after a successful Read() call. The conversion uses configured pressure range and output type coefficients. ```cpp if (pres.Read()) { float pressure_pa = pres.pres_pa(); // Convert to hPa (millibar) for display float pressure_hpa = pressure_pa / 100.0f; Serial.print("Pressure: "); Serial.print(pressure_hpa, 2); Serial.println(" hPa"); } // Expected output: "Pressure: 1013.25 hPa" (at standard atmosphere) ``` -------------------------------- ### Begin() Source: https://context7.com/bolderflight/ms4525do/llms.txt Initializes communication with the sensor by attempting up to 10 reads with 10 ms delays. Returns `true` on success, `false` if all attempts fail. The I2C bus must be initialized separately before calling `Begin()`. ```APIDOC ## `Begin()` Initializes communication with the sensor by attempting up to 10 reads with 10 ms delays between each attempt. Returns `true` if a successful read is obtained, `false` if all attempts fail. The I2C bus must be initialized separately before calling `Begin()`. ```cpp Wire.begin(); Wire.setClock(400000); if (!pres.Begin()) { // Sensor did not respond after 10 attempts (~100 ms) Serial.println("Sensor initialization failed. Check wiring and I2C address."); while (1) {} } // Sensor is ready Serial.println("Sensor ready."); ``` ``` -------------------------------- ### Begin Source: https://github.com/bolderflight/ms4525do/blob/main/README.md Initializes communication with the sensor. Returns true if communication is established, otherwise false. The communication bus must be initialized separately. ```APIDOC ## Begin ### Description Initializes communication with the sensor. True is returned if communication is able to be established, otherwise false is returned. The communication bus is not initialized within this library and must be initialized separately; this enhances compatibility with other sensors that may on the same bus. ### Request Example ```cpp Wire.begin(); Wire.setClock(400000); if (!pres.Begin()) { // ERROR } ``` ### Response #### Success Response (true) - **bool** - True if communication is established. #### Failure Response (false) - **bool** - False if communication fails. ### Method bool Begin() ``` -------------------------------- ### Begin() - Initialize Sensor Communication Source: https://context7.com/bolderflight/ms4525do/llms.txt Initializes communication with the sensor by attempting up to 10 reads. The I2C bus must be initialized and set to 400 kHz fast-mode before calling this function. Returns true on success, false on failure. ```cpp Wire.begin(); Wire.setClock(400000); if (!pres.Begin()) { // Sensor did not respond after 10 attempts (~100 ms) Serial.println("Sensor initialization failed. Check wiring and I2C address."); while (1) {} } // Sensor is ready Serial.println("Sensor ready."); ``` -------------------------------- ### Ms4525do() Default Constructor + Config() Source: https://context7.com/bolderflight/ms4525do/llms.txt Uses the default constructor and defers configuration to a separate `Config()` call. This is useful when the sensor object must be declared globally before bus parameters are known. ```APIDOC ## `Ms4525do()` Default Constructor + `Config()` Uses the default (empty) constructor and defers configuration to a separate `Config()` call. Useful when the sensor object must be declared globally before bus parameters are known (e.g., when the I2C bus is chosen at runtime). ```cpp #include "ms4525do.h" bfs::Ms4525do pres; // Default construction — no config yet void setup() { Serial.begin(9600); while (!Serial) {} Wire.begin(); Wire.setClock(400000); // Configure: bus=Wire, address=0x28, p_max=1.0 PSI, p_min=-1.0 PSI, Output Type B pres.Config(&Wire, 0x28, 1.0f, -1.0f, bfs::Ms4525do::OUTPUT_TYPE_B); if (!pres.Begin()) { Serial.println("ERROR: Sensor not found"); while (1) {} } } ``` ``` -------------------------------- ### Ms4525do Constructor (Parameterized) Source: https://context7.com/bolderflight/ms4525do/llms.txt Initializes the Ms4525do object with I2C bus, address, pressure range, and output type. Ensure the I2C bus is initialized and configured for fast mode before calling Begin(). ```cpp #include "ms4525do.h" // Declare a sensor: I2C bus Wire, address 0x28, ±1 PSI range, Output Type A (default) bfs::Ms4525do pres(&Wire, 0x28, 1.0f, -1.0f); void setup() { Serial.begin(9600); while (!Serial) {} Wire.begin(); Wire.setClock(400000); // 400 kHz fast mode if (!pres.Begin()) { Serial.println("ERROR: Could not communicate with MS4525DO"); while (1) {} } Serial.println("Sensor initialized."); } ``` -------------------------------- ### Include Ms4525do Library in Arduino Source: https://github.com/bolderflight/ms4525do/blob/main/README.md Include the Ms4525do library header file in your Arduino sketch. This is the standard way to begin using the library's functionality. ```cpp #include "ms4525do.h" ``` -------------------------------- ### Ms4525do Constructor (Parameterized) Source: https://context7.com/bolderflight/ms4525do/llms.txt Creates and configures an Ms4525do object. It takes an I2C bus pointer, sensor I2C address, pressure range (max and min in PSI), and an optional output type. ```APIDOC ## `Ms4525do` Constructor (Parameterized) Creates and fully configures an Ms4525do object in a single step. Accepts a pointer to the I2C bus, the 7-bit sensor I2C address, the maximum and minimum pressure range in PSI, and an optional output type (defaults to `OUTPUT_TYPE_A`). ```cpp #include "ms4525do.h" // Declare a sensor: I2C bus Wire, address 0x28, ±1 PSI range, Output Type A (default) bfs::Ms4525do pres(&Wire, 0x28, 1.0f, -1.0f); void setup() { Serial.begin(9600); while (!Serial) {} Wire.begin(); Wire.setClock(400000); // 400 kHz fast mode if (!pres.Begin()) { Serial.println("ERROR: Could not communicate with MS4525DO"); while (1) {} } Serial.println("Sensor initialized."); } ``` ``` -------------------------------- ### Ms4525do Default Constructor + Config() Source: https://context7.com/bolderflight/ms4525do/llms.txt Uses the default constructor and defers configuration to Config(). Useful when the sensor object is declared globally before bus parameters are known. The I2C bus must be initialized separately. ```cpp #include "ms4525do.h" bfs::Ms4525do pres; // Default construction — no config yet void setup() { Serial.begin(9600); while (!Serial) {} Wire.begin(); Wire.setClock(400000); // Configure: bus=Wire, address=0x28, p_max=1.0 PSI, p_min=-1.0 PSI, Output Type B pres.Config(&Wire, 0x28, 1.0f, -1.0f, bfs::Ms4525do::OUTPUT_TYPE_B); if (!pres.Begin()) { Serial.println("ERROR: Sensor not found"); while (1) {} } } ``` -------------------------------- ### Initialize I2C Communication and Begin Sensor Source: https://github.com/bolderflight/ms4525do/blob/main/README.md Initialize the I2C communication bus and attempt to establish communication with the sensor. Returns false if initialization fails. ```C++ Wire.begin(); Wire.setClock(400000); if (!pres.Begin()) { // ERROR } ``` -------------------------------- ### Ms4525do() Constructor Source: https://github.com/bolderflight/ms4525do/blob/main/README.md Default constructor for the Ms4525do sensor. Requires calling the Config method to set up the I2C bus, address, and pressure range. ```APIDOC ## Ms4525do() ### Description Default construction. Requires calling the *Config* method to setup the I2C bus, I2C address, and pressure range. ### Method Constructor ``` -------------------------------- ### Config Source: https://github.com/bolderflight/ms4525do/blob/main/README.md Configures the I2C bus, address, pressure range, and output type for the sensor. This is required when using the default constructor. ```APIDOC ## Config ### Description This is required when using the default constructor and sets up the I2C bus, I2C address, pressure range, and output type. ### Parameters #### Path Parameters - **bus** (TwoWire *) - Required - Pointer to the I2C bus object. - **addr** (uint8_t) - Required - I2C address of the sensor. - **p_max** (float) - Required - Maximum pressure range (PSI). - **p_min** (float) - Required - Minimum pressure range (PSI). - **type** (OutputType) - Optional - Sensor output type (defaults to OUTPUT_TYPE_A). ### Method void Config(TwoWire *bus, const uint8_t addr, const float p_max, const float p_min, const OutputType type = OUTPUT_TYPE_A) ``` -------------------------------- ### Ms4525do(TwoWire *bus, const uint8_t addr, const float p_max, const float p_min, const OutputType type = OUTPUT_TYPE_A) Constructor Source: https://github.com/bolderflight/ms4525do/blob/main/README.md Creates an Ms4525do object with specified I2C bus, address, pressure range, and output type. ```APIDOC ## Ms4525do(TwoWire *bus, const uint8_t addr, const float p_max, const float p_min, const OutputType type = OUTPUT_TYPE_A) ### Description Creates a Ms4525do object given a pointer to the I2C bus object, I2C address, maximum and minimum pressure range (PSI), and sensor output type. The available output types are: OUTPUT_TYPE_A, OUTPUT_TYPE_B. The output type defaults to OUTPUT_TYPE_A. ### Parameters #### Path Parameters - **bus** (TwoWire *) - Required - Pointer to the I2C bus object. - **addr** (uint8_t) - Required - I2C address of the sensor. - **p_max** (float) - Required - Maximum pressure range (PSI). - **p_min** (float) - Required - Minimum pressure range (PSI). - **type** (OutputType) - Optional - Sensor output type (defaults to OUTPUT_TYPE_A). ### Request Example ```cpp bfs::Ms4525do pres(&Wire, 0x28, 1.0f, -1.0f); ``` ### Method Constructor ``` -------------------------------- ### CMake Integration Source: https://context7.com/bolderflight/ms4525do/llms.txt Integrates the Ms4525do library into a CMake project. This involves fetching the library and its dependencies, setting up the toolchain, and linking the library to your executable. ```APIDOC ## CMake Integration ### Description The library exports a CMake target called `ms4525do`. Use `FetchContent` to pull it from GitHub and link it into any embedded CMake project targeting a supported Teensy/Cortex-M microcontroller. ### Usage Example ```cmake cmake_minimum_required(VERSION 3.14) include(FetchContent) # Fetch MCU support toolchain FetchContent_Declare( mcu_support GIT_REPOSITORY https://github.com/bolderflight/mcu-support.git GIT_TAG v1.1.0 ) FetchContent_MakeAvailable(mcu_support) set(CMAKE_TOOLCHAIN_FILE "${mcu_support_SOURCE_DIR}/cmake/cortex.cmake") project(MyProject VERSION 1.0 LANGUAGES CXX) include(${mcu_support_SOURCE_DIR}/cmake/config_mcu.cmake) configMcu(${MCU} ${mcu_support_SOURCE_DIR}) # Fetch ms4525do library FetchContent_Declare( ms4525do GIT_REPOSITORY https://github.com/bolderflight/ms4525do.git GIT_TAG v1.1.3 ) FetchContent_MakeAvailable(ms4525do) add_executable(my_app main.cc) target_link_libraries(my_app PRIVATE ms4525do) # Build from a 'build/' directory: # cmake .. -DMCU=MK66FX1M0 # make # make my_app_upload (to flash via Teensy CLI) ``` ``` -------------------------------- ### Linking Core Library Source: https://github.com/bolderflight/ms4525do/blob/main/CMakeLists.txt Links the 'core' library to the 'ms4525do' library. This ensures that the driver can utilize functionalities provided by the 'core' library. ```cmake target_link_libraries(ms4525do PUBLIC core ) ``` -------------------------------- ### Read Source: https://github.com/bolderflight/ms4525do/blob/main/README.md Reads data from the sensor and stores it in the Ms4525do object. Returns true if data is successfully read, otherwise false. ```APIDOC ## Read ### Description Reads data from the sensor and stores the data in the Ms4525do object. Returns true if data is successfully read, otherwise, returns false. ### Request Example ```cpp /* Read the sensor data */ if (pres.Read()) { } ``` ### Response #### Success Response (true) - **bool** - True if data is successfully read. #### Failure Response (false) - **bool** - False if data reading fails. ### Method bool Read() ``` -------------------------------- ### Library Target Definition Source: https://github.com/bolderflight/ms4525do/blob/main/CMakeLists.txt Defines the main library target 'ms4525do' with its source files. This is the core component of the sensor driver. ```cmake add_library(ms4525do src/ms4525do.h src/ms4525do.cpp ) ``` -------------------------------- ### Declare Ms4525do Object with Specific Configuration Source: https://github.com/bolderflight/ms4525do/blob/main/README.md Declare an Ms4525do object with a specific I2C address, pressure range, and output type. Ensure the I2C bus is initialized separately. ```C++ bfs::Ms4525do pres(&Wire, 0x28, 1.0f, -1.0f); ``` -------------------------------- ### Read() Source: https://context7.com/bolderflight/ms4525do/llms.txt Requests 4 bytes from the sensor over I2C and decodes pressure, temperature, and status bits. Returns `true` if all bytes are received, the sensor status is `STATUS_GOOD`, and the decoded temperature is within the valid range. Updates internal pressure (Pa) and temperature (°C) values. ```APIDOC ## `Read()` Requests 4 bytes from the sensor over I2C and decodes pressure counts, temperature counts, and status bits. Returns `true` only when all 4 bytes are received, the sensor status is `STATUS_GOOD`, and the decoded temperature is within the valid range (−50 to +150 °C). On success, updates the internal pressure (Pa) and temperature (°C) values accessible via `pres_pa()` and `die_temp_c()`. ```cpp void loop() { if (pres.Read()) { // Data is fresh and valid Serial.print("Pressure (Pa): "); Serial.println(pres.pres_pa(), 4); Serial.print("Temperature (C): "); Serial.println(pres.die_temp_c(), 4); } else { // Could be stale data, a fault, or an I2C communication failure Serial.println("Read failed or sensor fault."); bfs::Ms4525do::Status s = pres.status(); if (s == bfs::Ms4525do::STATUS_STALE_DATA) { Serial.println(" Reason: Stale data"); } else if (s == bfs::Ms4525do::STATUS_FAULT) { Serial.println(" Reason: Sensor fault detected"); } } delay(10); // ~100 Hz polling rate } ``` ``` -------------------------------- ### Read() - Decode Sensor Data Source: https://context7.com/bolderflight/ms4525do/llms.txt Requests data from the sensor, decodes pressure, temperature, and status. Returns true if data is fresh, valid, and within expected temperature range. Updates internal pressure (Pa) and temperature (°C) values. Handles stale data, sensor faults, and I2C communication failures. ```cpp void loop() { if (pres.Read()) { // Data is fresh and valid Serial.print("Pressure (Pa): "); Serial.println(pres.pres_pa(), 4); Serial.print("Temperature (C): "); Serial.println(pres.die_temp_c(), 4); } else { // Could be stale data, a fault, or an I2C communication failure Serial.println("Read failed or sensor fault."); bfs::Ms4525do::Status s = pres.status(); if (s == bfs::Ms4525do::STATUS_STALE_DATA) { Serial.println(" Reason: Stale data"); } else if (s == bfs::Ms4525do::STATUS_FAULT) { Serial.println(" Reason: Sensor fault detected"); } } delay(10); // ~100 Hz polling rate } ``` -------------------------------- ### status Source: https://github.com/bolderflight/ms4525do/blob/main/README.md Returns the latest status from the sensor, indicating the operational state. ```APIDOC ## status ### Description Returns the latest status from the sensor. The status options are: STATUS_GOOD, STATUS_STALE_DATA, STATUS_FAULT. ### Response #### Success Response - **Status** - The current status of the sensor. - STATUS_GOOD: Normal Operation. Good Data Packet - STATUS_STALE_DATA: Stale Data. Data has been fetched since last measurement cycle. - STATUS_FAULT: Fault Detected ### Method Status status() ``` -------------------------------- ### status() Source: https://context7.com/bolderflight/ms4525do/llms.txt Retrieves the sensor's status byte as a `Status` enum. This status is updated on every `Read()` call, regardless of success. Possible statuses include `STATUS_GOOD`, `STATUS_STALE_DATA`, and `STATUS_FAULT`. ```APIDOC ## `status()` ### Description Returns the status byte decoded from the most recent raw sensor read as a `Status` enum. Updated on every `Read()` call regardless of whether `Read()` returned `true` or `false`. Possible values are `STATUS_GOOD` (0x00), `STATUS_STALE_DATA` (0x02), and `STATUS_FAULT` (0x03). ### Usage Example ```cpp // Poll sensor and inspect status even on failure bool ok = pres.Read(); bfs::Ms4525do::Status s = pres.status(); switch (s) { case bfs::Ms4525do::STATUS_GOOD: Serial.println("Status: Good"); break; case bfs::Ms4525do::STATUS_STALE_DATA: Serial.println("Status: Stale data — fetched before new measurement cycle"); break; case bfs::Ms4525do::STATUS_FAULT: Serial.println("Status: Sensor fault detected"); break; default: Serial.println("Status: Unknown"); break; } ``` ``` -------------------------------- ### Read Sensor Data Source: https://github.com/bolderflight/ms4525do/blob/main/README.md Read the latest data from the sensor. Returns true if the data is successfully read, otherwise false. ```C++ /* Read the sensor data */ if (pres.Read()) { } ``` -------------------------------- ### die_temp_c() Source: https://context7.com/bolderflight/ms4525do/llms.txt Retrieves the sensor's internal die temperature in degrees Celsius. This value is a float and is only valid after a successful `Read()` operation. The temperature is decoded from an 11-bit count within a range of -50 to +150 °C. ```APIDOC ## `die_temp_c()` ### Description Returns the most recently decoded sensor die temperature in degrees Celsius as a `float`. This reflects the internal temperature of the sensor IC, not ambient air temperature. Only valid after a successful `Read()`. Decoded from an 11-bit count over a −50 to +150 °C range. ### Usage Example ```cpp if (pres.Read()) { float temp = pres.die_temp_c(); Serial.print("Die Temperature: "); Serial.print(temp, 2); Serial.println(" C"); } // Expected output: "Die Temperature: 24.56 C" ``` ``` -------------------------------- ### pres_pa Source: https://github.com/bolderflight/ms4525do/blob/main/README.md Returns the pressure data from the sensor in units of Pascals (Pa). ```APIDOC ## pres_pa ### Description Returns the pressure data from the object in units of Pa. ### Response #### Success Response - **float** - Pressure reading in Pascals (Pa). ### Request Example ```cpp float pressure = pres.pres_pa(); ``` ### Method float pres_pa() ``` -------------------------------- ### die_temp_c Source: https://github.com/bolderflight/ms4525do/blob/main/README.md Returns the die temperature of the sensor in degrees Celsius (°C). ```APIDOC ## die_temp_c ### Description Returns the die temperature of the sensor from the object in units of degrees C. ### Response #### Success Response - **float** - Die temperature in degrees Celsius (°C). ### Request Example ```cpp float temperature = pres.die_temp_c(); ``` ### Method float die_temp_c() ``` -------------------------------- ### pres_pa() Source: https://context7.com/bolderflight/ms4525do/llms.txt Returns the most recently decoded pressure value in Pascals (Pa) as a `float`. This value is only valid after a successful `Read()` call. The conversion uses configured pressure range and output type coefficients. ```APIDOC ## `pres_pa()` Returns the most recently decoded pressure value in Pascals (Pa) as a `float`. Only valid after a successful `Read()` call. The conversion from raw counts uses the configured pressure range and output type coefficients. ```cpp if (pres.Read()) { float pressure_pa = pres.pres_pa(); // Convert to hPa (millibar) for display float pressure_hpa = pressure_pa / 100.0f; Serial.print("Pressure: "); Serial.print(pressure_hpa, 2); Serial.println(" hPa"); } // Expected output: "Pressure: 1013.25 hPa" (at standard atmosphere) ``` ``` -------------------------------- ### Read Sensor Die Temperature Source: https://context7.com/bolderflight/ms4525do/llms.txt Reads the sensor's internal die temperature in Celsius. This value is only valid after a successful `Read()` call. The temperature is decoded from an 11-bit count over a -50 to +150 °C range. ```cpp if (pres.Read()) { float temp = pres.die_temp_c(); Serial.print("Die Temperature: "); Serial.print(temp, 2); Serial.println(" C"); } // Expected output: "Die Temperature: 24.56 C" ``` -------------------------------- ### Check Sensor Status Source: https://context7.com/bolderflight/ms4525do/llms.txt Retrieves the status byte from the most recent sensor read. The status is updated on every `Read()` call, regardless of success. Possible statuses include `STATUS_GOOD`, `STATUS_STALE_DATA`, and `STATUS_FAULT`. ```cpp // Poll sensor and inspect status even on failure bool ok = pres.Read(); bfs::Ms4525do::Status s = pres.status(); switch (s) { case bfs::Ms4525do::STATUS_GOOD: Serial.println("Status: Good"); break; case bfs::Ms4525do::STATUS_STALE_DATA: Serial.println("Status: Stale data — fetched before new measurement cycle"); break; case bfs::Ms4525do::STATUS_FAULT: Serial.println("Status: Sensor fault detected"); break; default: Serial.println("Status: Unknown"); break; } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.