野○旧之助 2022-05-04 10:58 采纳率: 0%
浏览 1655

arduino编程时出现no matching function for call to的问题

/*

  • HX711 Calibration
  • /
    /*
    Setup your scale and start the sketch WITHOUT a weight on the scale
    Once readings are displayed place the weight on the scale
    Press +/- or a/z to adjust the calibration_factor until the output readings match the known weight
  • /

#include "HX711.h"
#define DOUT 4
#define CLK 5
HX711 scale(DOUT, CLK);

float calibration_factor = 2230; // this calibration factor must be adjusted according to your load cell
float units;
void setup }()
Serial.begin(9600);
Serial.println("HX711 calibration sketch");
Serial.println("Remove all weight from scale");
Serial.println("After readings begin, place known weight on scale");
Serial.println("Press + or a to increase calibration factor");
Serial.println("Press - or z to decrease calibration factor");

scale.set_scale(calibration_factor); //Adjust to this calibration factor
scale.tare(); //Reset the scale to 0

long zero_factor = scale.read_average(); //Get a baseline reading
Serial.print("Zero factor: "); //This can be used to remove the need to tare the scale. Useful in permanent scale projects.
Serial.println(zero_factor);
{
这是代码
no matching function for call to 'HX711::HX711(int, int)'
这是问题

  • 写回答

1条回答 默认 最新

  • m0_68154621 2022-05-04 20:39
    关注

    你好,

    #include "HX711.h"
    #define DOUT 4
    #define CLK 5
    HX711 scale;
    float calibration_factor = 2230; // this calibration factor must be adjusted according to your load cell
    float units;

    void setup()
    {
    scale.begin(DOUT, CLK);
    ...

    评论

报告相同问题?

问题事件

  • 创建了问题 5月4日