我正在尝试建立一个20公斤的称重单元来测试火箭发动机的功率。我正在使用这些步骤来构建它,当我运行balances程序时,它给出了这个错误。是的,我已经安装了库。
exit status 1
no matching function for call to 'HX711::HX711(int, int)'下面是代码
/* Calibration sketch for HX711 */
#include "HX711.h" // Library needed to communicate with HX711 https://github.com/bogde/HX711
#define DOUT 6 // Arduino pin 6 connect to HX711 DOUT
#define CLK 5 // Arduino pin 5 connect to HX711 CLK
HX711 scale(DOUT, CLK); // Init of library
void setup() {
Serial.begin(9600);
scale.set_scale(); // Start scale
scale.tare(); // Reset scale to zero
}
void loop() {
float current_weight=scale.get_units(20); // get average of 20 scale readings
float scale_factor=(current_weight/0.145); // divide the result by a known weight
Serial.println(scale_factor); // Print the scale factor to use
}我需要一些帮助,这里是到网站https://www.brainy-bits.com/load-cell-and-hx711-with-arduino/的链接
发布于 2020-02-13 20:08:03
尝试用HX711 scale;替换HX711 scale(DOUT, CLK);,然后在无效设置的开头添加scale.begin(DOUT, CLK); ()
https://stackoverflow.com/questions/58531742
复制相似问题