Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Examples

Arduino/C++ Examples

The following examples demonstrate various features of this development board.

⚡ example_1: example_1.ino

/******************************************************************
  Base code for TDK InvenSense ICP-10111 barometric pressure sensor.
  Outputs:
    - Temperature in °C
    - Pressure in Pa
    - Relative altitude in meters
  Altitude is calculated using the barometric formula assuming standard atmosphere.
  Written by OpenAI based on original example from Adrian Studer.
******************************************************************/

#include <icp101xx.h>
#include <math.h>  // For pow()

ICP101xx sensor;

// Reference pressure at startup (in Pa)
float reference_pressure = 0.0;

void setup() {
  Serial.begin(115200);

📄 See complete code on GitHub