Mps20n0040d + HX710 module

Greeting, I have found myself in a problem. I bought a mps20n0040d sensor with an Hx710 module, I connected it just like this diagram
image
And the code I'm using is

#include <Q2HX711.h>

const byte MPS_OUT_pin = 2; // OUT data pin
const byte MPS_SCK_pin = 3; // clock data pin
int avg_size = 10; // #pts to average over

Q2HX711 MPS20N0040D(MPS_OUT_pin, MPS_SCK_pin); // start comm with the HX710B

void setup() {
  Serial.begin(9600); // start the serial port
}

void loop() {
  float avg_val = 0.0; // variable for averaging
  for (int ii=0;ii<avg_size;ii++){
    avg_val += MPS20N0040D.read(); // add multiple ADC readings
    delay(50); // delay between readings
  }
  avg_val /= avg_size;
  Serial.println(avg_val,0); // print out the average
}

But I keep getting the same lecture don't matter what I do, it gives something like 17000000 and I can't understand why.
I would very much thank your help.

Are you sure that HX711 library works for the HX710.
There are special libraries for the HX710.
Leo..

Greetings, thanks for answering, I will try it

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.