45 lines
700 B
Arduino
Raw Normal View History

2021-01-29 12:31:58 +01:00
//
// FILE: asdx_minimal.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo
// DATE: 2020-06-18
// URL: https://github.com/RobTillaart/I2C_ASDX
2021-12-19 17:54:58 +01:00
2021-01-29 12:31:58 +01:00
#include "I2C_ASDX.h"
// adjust to type of sensor
I2C_ASDX sensor(0x58, 100);
2021-12-19 17:54:58 +01:00
2021-01-29 12:31:58 +01:00
void setup()
{
Serial.begin(115200);
Serial.println(__FILE__);
sensor.begin();
}
2021-12-19 17:54:58 +01:00
2021-01-29 12:31:58 +01:00
void loop()
{
int state = sensor.read();
if (state == I2C_ASDX_OK)
{
Serial.print("mBar:\t");
Serial.println(sensor.getMilliBar());
Serial.print(" Bar:\t");
Serial.println(sensor.getBar());
Serial.print(" PSI:\t");
Serial.println(sensor.getPSI());
Serial.println();
}
else Serial.println("error");
delay(1000);
}
2021-12-19 17:54:58 +01:00
2021-01-29 12:31:58 +01:00
// =- END OF FILE --
2021-12-19 17:54:58 +01:00