qaz
January 31, 2019, 11:06pm
1
I’m trying to get my load cell and HX711 to work with a nodeMCU but it keeps reading the same number and doesn’t change when I put weight on the cell. It could be a problem with the code or the wiring.
#include <HX711.h>
HX711 scale(4,0);
void setup() {
Serial.begin(9600);
scale.begin(4,0);
}
void loop() {
Serial.println(scale.read());
delay(500);
}
qaz:
HX711 scale(4,0);
GPIO4 (labelled as D2 on theNodeMCU) is an okay pin to use, but GPIO0 (labelled as D3 on the NodeMCU) isn’t such a good choice of pin.
hi blynkers!
the esp8266 mcu is widely used in iot projects. however, most gpio pins on this mcu have special / multiple functionality and are not safe to use in all circumstances.
these “features” are still not well documented and not explained in a friendly manner for newbies. i see lots of cases when the “issues” are simply caused by not knowing which pins to use in which case.
[esp8266 pin features]
here is a basic table for startup. i’ve collected the info from various sources on the i…
I suspect that in reality you’re getting your GPIO and D pin designations mixed-up.
https://pradeepsinghblog.files.wordpress.com/2016/04/nodemcu_pins.png?w=616
Pete.