Hi Guys! i have a problem with the reading with my NODEMCU where i tried this code on an arduino UNO it is working perfectly fine but until i tried to switch it to NODEMCU 1.0 which have a wifi function that i need, the reading turn out to have this type of error, i've tried looking for solution online and tried every single of them but apparently none of it help. The image is the error i have faced and the connection i have made from the nodemcu to hx711 is VCC --> Vin or 3.3v, GND --> GND, DT --> D2, SCK --> D3. Here's the code that i found online to use:
#include <HX711.h>
// Scale Settings
const int SCALE_DOUT_PIN = D2;
const int SCALE_SCK_PIN = D3;
HX711 scale(SCALE_DOUT_PIN, SCALE_SCK_PIN);
void setup() {
Serial.begin(115200);
scale.set_scale(-47740);// <- set here calibration factor!!!
scale.tare();
}
void loop() {
float weight = scale.get_units(1);
Serial.println(String(weight, 3));
}
Thanks in advance!!