Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 2.03 KB

File metadata and controls

27 lines (18 loc) · 2.03 KB
icon
simple/arduino

Example 1 - Continuous Mode

The first example demonstrates how to initialize the sensor over I2C to measure CO2 data in Continuous Mode and print it out over serial. Open the example by navigating to File > Examples > XENSIV PAS CO2 > continuous-mode. After opening the example, select your Board and Port (in our case, SparkFun RedBoard IoT), and click "Upload". Open the serial terminal with the baud set to 9600 and you should see the same as the screenshot below:

[![Screenshot of serial printout from continuous mode example.](./assets/images/Continuous_Mode-Serial_Print.jpg){ width="400"}](./assets/images/Early_Measurement-Serial_Print.jpg "Click to enlarge")

Example 2 - Boost Regulator Early Notification

The second example follows the assembly step in the Hardware Assembly section tying the PAS CO2's INT pin to the boost regulator's EN pin to control power for the regulator during measurements. This is a custom example we wrote so you'll need to get it from the GitHub Repository or by copying the code below into a blank sketch:

??? "Early Measurement Example"

```
 --8<-- "https://raw.githubusercontent.com/sparkfun/SparkFun_Qwiic_CO2_Sensor_XENSIV_PAS/main/Firmware/Examples/Example01_EarlyMeasurementStartInterrupt/Example01_EarlyMeasurementStartInterrupt.ino"
```

Select your board and port and upload the example. After the uploade completes, open the serial terminal with the baud set to 115200 and you should see a printout similar to the one below with CO2 measurements printing every ten seconds:

[![Screenshot of serial printout from early measurement example.](./assets/images/Early_Measurement-Serial_Print.jpg){ width="400"}](./assets/images/Early_Measurement-Serial_Print.jpg "Click to enlarge")