1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "HX710B.h"
const int OUT = 2;
const int SCK = 3;
HX710B pressure_sensor;
void setup() {
Serial.begin(57600);
pressure_sensor.begin(OUT, SCK);
}
void loop(){
if (pressure_sensor.is_ready()) {
Serial.print("Pascal: ");
Serial.println(pressure_sensor.pascal());
Serial.print("ATM: ");
Serial.println(pressure_sensor.atm());
Serial.print("mmHg: ");
Serial.println(pressure_sensor.mmHg());
Serial.print("PSI: ");
Serial.println(pressure_sensor.psi());
} else {
Serial.println("Pressure sensor not found.");
}
delay(1000);
}
}