Newbie here. I need help, my 2 load cell sensors are currently can run individuall but when both sensors are being joined(integrated) together the serial output only displays 7 consecutive output and it stops.
#include "HX711.h"
// parameter "gain" is ommited; the default value 128 is used by the library
// HX711.DOUT - pin #A1
// HX711.PD_SCK - pin #A0
HX711 scale;
HX711 scale1;
long temp=0;
long temp1=0;
int Value=0;
int Value1=0;
void setup() {
Serial.begin(38400);
scale.begin(A1, A0);
scale.set_scale(2280.f); // this value is obtained by calibrating the scale with known weights; see the README for details
scale.tare();
scale1.begin(A3, A2);
scale1.set_scale(2280.f);
scale1.tare();
}
void loop() {
// put your main code here, to run repeatedly:
temp = scale.get_units(), 1;
temp = temp*10;
Value = (int)(temp);
Serial.println(Value);
temp1 = scale1.get_units(), 1;
temp1 = temp1*10;
Value1 = (int)(temp1);
Serial.println(Value1);
}
I don't see a question in your last post. Did you intend to ask one?
Are you aware that there's a nice little code reference on this site at Arduino - Home? Bookmark it and refer to it often. Especially please read up on Serial and its println function...notably println(val,format)...with attention to my post #3.
Also, do you understand the code and the comments in the following code from the bogde library?
Serial.print("read: \t\t");
Serial.println(scale.read()); // print a ***raw*** reading from the ADC
Serial.print("read average: \t\t");
Serial.println(scale.read_average(20)); // print the average of 20 readings from the ADC
Serial.print("get value: \t\t");
Serial.println(scale.get_value(5)); // print the average of 5 readings from the ADC minus the tare weight, set with tare()
Serial.print("get units: \t\t");
Serial.println(scale.get_units(5), 1); // ***print*** the average of 5 readings from the ADC minus tare weight, divided
// by the SCALE parameter set with set_scale