DFRobot_HX711_I2C connect to MKR1010

userHead jeroendegroote 2022-07-11 19:32:45 1021 Views1 Replies

Dear,

 

I am struggling to connect my DFrobot HX711 to a MKR1010 via I2C. I am following the guidelines documented there; https://wiki.dfrobot.com/HX711_Weight_Sensor_Kit_SKU_KIT0176 

This describes the process for implementing the gravity I2C 1kg weight sensor kit (KIT0176). This is the exact kit I bought. When running the example sketch ‘getCalibration’, I don not succeed in compiling it for an MKR1010, nor for an Arduino Uno. 

 

i get the following error: 

 

"

 

Arduino: 1.8.19 (Windows 10), Board: "Arduino MKR WiFi 1010"


In file included from C:\Users\jerdgroo\Documents\Arduino\libraries\DFRobot_HX711_I2C\examples\readWeight\readWeight.ino:13:0: 
C:\Users\jerdgroo\Documents\Arduino\libraries\DFRobot_HX711_I2C/DFRobot_HX711_I2C.h:26:33: error: expected ',' before 'sensor' 
#define HX711_I2C_ADDR  (0x64)  sensor IIC address*/ 
                                ^ 
C:\Users\jerdgroo\Documents\Arduino\libraries\DFRobot_HX711_I2C/DFRobot_HX711_I2C.h:48:60: note: in expansion of macro 'HX711_I2C_ADDR' 
  DFRobot_HX711_I2C(TwoWire * pWire = &Wire,uint8_t addr = HX711_I2C_ADDR); 
                                                           ^~~~~~~~~~~~~~ 
exit status 1 
Error compiling for board Arduino MKR WiFi 1010.


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

"

 

As far as my understanding goes, my best guess is that something is wrong with setting up the I2C address at the start of the sketch. I did not change anything in the example sketch. However, I am unsure if this could be why the sketch does not compile. Could someone point out what the potential solution could be? 

Thanks in advance!!

Jeroen

2023-02-02 17:02:47

HI

Sorry for the late response

The demo code on Wiki do not contain #define HX711_I2C_ADDR  (0x64)  sensor IIC address*/ now, maybe it has been updated.

Could you please try the demo code of new version again?

Hope it will help.

userHeadPic Tonny12138