เขียนโค็ตsensorน้ำหนัก " 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
}
มันขึ้น error
Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "Arduino/Genuino Uno"

Arduino_Auto_Cal:6:22: error: no matching function for call to 'HX711::HX711(int, int)'

 HX711 scale(DOUT, CLK);  // Init of library

                      ^

In file included from C:\Users\Nitro\Downloads\Code HX711 and Loadcell\Arduino_Auto_Cal\Arduino_Auto_Cal.ino:1:0:

C:\Users\Nitro\Documents\Arduino\libraries\HX711-master\src/HX711.h:30:3: note: candidate: HX711::HX711()

   HX711();

   ^

C:\Users\Nitro\Documents\Arduino\libraries\HX711-master\src/HX711.h:30:3: note:   candidate expects 0 arguments, 2 provided

C:\Users\Nitro\Documents\Arduino\libraries\HX711-master\src/HX711.h:19:7: note: candidate: constexpr HX711::HX711(const HX711&)

 class HX711

       ^

C:\Users\Nitro\Documents\Arduino\libraries\HX711-master\src/HX711.h:19:7: note:   candidate expects 1 argument, 2 provided

exit status 1
no matching function for call to 'HX711::HX711(int, int)'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
แสดงความคิดเห็น
โปรดศึกษาและยอมรับนโยบายข้อมูลส่วนบุคคลก่อนเริ่มใช้งาน อ่านเพิ่มเติมได้ที่นี่