if (pressure_sensor.is_ready()) {
Serial.print("PSI: ");
Serial.println(pressure_sensor.psi());
} else {
Serial.println("Pressure sensor not found.");
}
delay(1000);
}
ERROR WHILE UPLODING
C:\Users\pgnan\Downloads\hx710B_pressure_sensor-main\hx710B_pressure_sensor-main\examples\HX710B_Basic\HX710B_Basic.ino: In function 'void setup()':
C:\Users\pgnan\Downloads\hx710B_pressure_sensor-main\hx710B_pressure_sensor-main\examples\HX710B_Basic\HX710B_Basic.ino:10:19: error: 'class HX710B' has no member named 'begin'
pressure_sensor.begin(DOUT,SCLK);
^~~~~
C:\Users\pgnan\Downloads\hx710B_pressure_sensor-main\hx710B_pressure_sensor-main\examples\HX710B_Basic\HX710B_Basic.ino: In function 'void loop()':
C:\Users\pgnan\Downloads\hx710B_pressure_sensor-main\hx710B_pressure_sensor-main\examples\HX710B_Basic\HX710B_Basic.ino:15:23: error: 'class HX710B' has no member named 'is_ready'; did you mean 'isReady'?
if (pressure_sensor.is_ready()) {
^~~~~~~~
isReady
C:\Users\pgnan\Downloads\hx710B_pressure_sensor-main\hx710B_pressure_sensor-main\examples\HX710B_Basic\HX710B_Basic.ino:17:36: error: 'class HX710B' has no member named 'psi'
Serial.println(pressure_sensor.psi());
^~~
exit status 1
Compilation error: 'class HX710B' has no member named 'begin'
Before I try to read your code and figure out what you want please spend the time to read the forum guidelines and post your code using code tags. Since I cannot see what you have also post links to technical information on the hardware items and your preliminary schematic be sure to show all power, ground and power sources.
YES I TRIED BOTH
BY PBernalPolo and Andhie Setyabudi..
both not worked showing same error
Compilation error: 'class HX710' has no member named 'begin'; did you mean 'beginData'?
Compilation error: 'class HX710B' has no member named 'begin'
I installed the first HX710 library I saw in Library Manager.
It came with examples.
They use in setup()
ps.initialize( PD_SCK , DOUT );
not pressure_sensor.begin(DOUT,SCLK);
Make sure you use the right code with the library that you're using.
Maybe remove all the HX710 libraries, and start again.
And restart the IDE after you have installed a new library.
Leo..
But you forgot to look at the examples in the library, to see if they matched the calls in your program, or test any of the library examples. See post #3.