bogde / HX711

An Arduino library to interface the Avia Semiconductor HX711 24-Bit Analog-to-Digital Converter (ADC) for Weight Scales.
MIT License
896 stars 538 forks source link

Fixed gpio not configured as pullup for non espressif boards. #233

Closed nschurando closed 2 years ago

nschurando commented 2 years ago

Fixes issue https://github.com/bogde/HX711/issues/232.

vschlegel commented 2 years ago

i just had the same issue and can confirm this worked. @bogde could you please merge this?

bogde commented 2 years ago

Done, thanks @nschurando for your contribution, thanks @ioeides for confirming.

vschlegel commented 2 years ago

Damn, my fault. I also changed line 83 from pinMode(DOUT, DOUT_MODE); to pinMode(DOUT, INPUT_PULLUP); in my code. This overwrites the issue as well as the change made by @nschurando

With both the Versions before and after this merge, i get the same issue.

In file included from .pio/libdeps/cubecell_board/HX711/src/HX711.cpp:10:
.pio/libdeps/cubecell_board/HX711/src/HX711.cpp: In member function 'void HX711::begin(byte, byte, byte)':
/home/val/.platformio/packages/framework-arduinoasrmicro/cores/asr650x/Arduino.h:86:27: error: 'PINMODE_DOUT_MODE' was not declared in this scope; did you mean 'PINMODE_OUTPUT'?
   86 | #define pinMode(pin,mode) PINMODE_ ## mode(pin)
      |                           ^~~~~~~~
.pio/libdeps/cubecell_board/HX711/src/HX711.cpp:83:2: note: in expansion of macro 'pinMode'
   83 |  pinMode(DOUT, DOUT_MODE);
      |  ^~~~~~~
*** [.pio/build/cubecell_board/lib1ea/HX711/HX711.cpp.o] Error 1