I am trying to measure thrust forces using a beam type sensor, a HX711 module, and a Freaduino UNO board. It is like the project here:
http://www.dfrobot.com/wiki/index.php/Weight_Sensor_Module_V1
I was unable to find that particular weight sensor module and am using this one:
http://www.nyplatform.com/index.php?route=product/product&path=114_143&product_id=746
I downloaded and installed the library from the link there, it is installed in folder /libraries/Hx711 that contains files Hx711.cpp, Hx711.h, and a samples folder with folders named LiquidCrystalScale and Serial Scale containing files LiquidCrystalScale.ino and SerialScale.ino files.
I copied the sample code from that page and pasted it into a new sketch in the IDE. When I try to upload the sketch I get the error 'Hx711' does not name a type and the statement "Hx711 scale(A2, A3);" is highlighted in yellow.
Can anyone explain this problem to me?
The code is below.
Jack
/*
* description:
* The sample code for digital weight scale of hx711. The weight will be printed in the serial.
* library host on https://github.com/aguegu/ardulibs/tree/3cdb78f3727d9682f7fd22156604fc1e4edd75d1/hx711
* connection:
Hx711.DOUT - pin #A2
Hx711.SCK - pin #A3
*/
#include <Hx711.h>
Hx711 scale(A2, A3);
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.print(scale.getGram(), 1);
Serial.println(" g");
delay(200);
}
