Chat freely about anything...

User avatar
By rca
#26232 ok, i attempted it myself - following the hx711 code and advice on bit banging (gpio.write takes 100us, while gpio_write 10us !)

this works for me, using nodemcu devkit, with v0.9.5 build 2015-02-13

Code: Select allDOUT = 6
SCLK =  5

gpio_mode = gpio.mode
gpio_read = gpio.read
gpio_write = gpio.write

INPUT = gpio.INPUT
OUTPUT = gpio.OUTPUT
HIGH = gpio.HIGH
LOW = gpio.LOW

gpio_mode(DOUT, INPUT)
gpio_mode(SCLK, OUTPUT)

gpio_write(SCLK, LOW)

out = "" -- 24 bit word
print("start")
while gpio_read(DOUT) == HIGH do end -- wait until DT goes LOW and ADC is ready to be read

for i=1,24 do
  gpio_write(SCLK, HIGH)
  out = out .. gpio_read(DOUT)
  gpio_write(SCLK, LOW)
end

print(tonumber(out, 3))
User avatar
By gsker
#34264 I'm trying this too and also seeing only 4294967295 on gpio_read(DOUT).
I would have used the hx711 library here https://github.com/TerryE/nodemcu-firmware but I can't get a succesful build environment.
When I moved it to GPIO4 and GPIO5, I just get a wdt restart.

Did you ever have any success?

dmantamp wrote:Hi,
I have been looking for a piece of code to talk to HX711. I executed this one, and all I am getting is '4294967295' All bits seems to be 1). It does not change. Any help ?

Thanks
DM



edit: I have a build environment now.... so I'm going to try to get the hxu11 module working.

edit much later (2016-Jan-9): Ii did get the hx711 module working and it has been very reliable. The module is available in the autobuild environment too. http://nodemcu-build.com/
The hx711 and the load cells that I have are very unstable, though, so I was overly optimistic about the components.