Hello Divyansh here i needed a help as i am new to the arduino programing.
I am facing a problem in the code of arduino loadcell
The system says
no matching function for call to 'HX711::HX711(const uint8_t&, const uint8_t&)'
This is my code
/*
Arduino pin to HX711
A2 -> CLK
A1 -> DAT
5V -> VCC
GND -> GND
The HX711 board can be powered from 2.7V to 5V so the Arduino 5V power should be fine.
*/
#include <LiquidCrystal.h>
#include <HX711.h>
int button1 = 9;
int press1 = 0;
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
HX711 scale1(A1, A2);
#define MAXFLT 8 // 24 bit resolution is 7 digits
void setup() {
lcd.clear();
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print(" Weighing Scale ");
lcd.setCursor(0, 1);
lcd.print("----MakerMan----");
delay(3000);
lcd.setCursor(0, 0);
lcd.print("--Place Weight--");
lcd.setCursor(0, 1);
lcd.print(" ..... kg ");
scale1.set_scale(-11410); // BUG: calibrate the scale (higher number, lower reading)
scale1.tare(); // reset the scale to zero
pinMode(button1, INPUT);
digitalWrite(button1, HIGH); //enable pullups to make pin high
}
void loop() {
float r;
char buf[MAXFLT + 1];
r = scale1.get_units(5); // average 10 readingslcd.print(scale1.get_units(10), 3); // average 10 readings
Serial.println(dtostrf(r, MAXFLT, 3, buf));
lcd.setCursor(0, 1);
lcd.print(dtostrf(r, MAXFLT, 2, buf)); // average 10 readings, approx 1 second
{
press1 = digitalRead(button1);
if (press1 == LOW)
{
scale1.tare();
}
else {
/// do nothing
}
}
}
Dot