Created
August 30, 2022 06:41
-
-
Save labsguru/434f95ea735851bd37617ddbaf4fbc20 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "HX710B.h" | |
| const int DOUT = 2; //sensor data pin | |
| const int SCLK = 3; //sensor clock pin | |
| HX710B pressure_sensor; | |
| void setup() { | |
| Serial.begin(57600); | |
| pressure_sensor.begin(DOUT, SCLK); | |
| } | |
| 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); | |
| } //CREDITS : https://www.teachmemicro.com/arduino-pressure-sensor-tutorial/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment