Soft wdt reset?

WTF?

simple code like this also made the WeMos D1 R1 resets!

#include <HX711.h>

// Scale Settings
const int SCALE_DOUT_PIN = D4;
const int SCALE_SCK_PIN = D5;

HX711 scale;

void setup() {
Serial.begin(115200);
scale.set_scale();// <- set here calibration factor!!!
scale.tare();
}

void loop() {
float weight = scale.get_units(1);
Serial.println(String(weight, 2));
}

Soft WDT reset

Exception (4):
epc1=0x401001fa epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

>>>stack>>>

never called scale.begin()..
check your lib..
sorry.. ~q

1 Like

do you mean i should add scale.begin(); in my code?

well you have to put something in the begin..
from your lib..

// Initialize library with data output pin, clock input pin and gain factor.
		// Channel selection is made by passing the appropriate gain:
		// - With a gain factor of 64 or 128, channel A is selected
		// - With a gain factor of 32, channel B is selected
		// The library default is "128" (Channel A).
		void begin(byte dout, byte pd_sck, byte gain = 128);

looks like you got them pins declared too..
have fun.. ~q

Hi, it's working now.
i wondered if scale.begin(X,Y); causes the restarts or the amplifier got issue here.
I recently changed amplifier and added the function above and now it works

see all them 0's , you're playing with nulls, figured it was an object not initialized..

have fun.. ~q

interesting! im not very familiar with this exception codes thrown by IDE
But i'm glad my code works now after scalebegin(SOCKETX,SOCKETY); recommended by you!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.