I' trying again the spi library with no results
Just to check the connections:
load cell to HX711:
red to E+
black to E-
white to A-
green to A+
Hx711 to ESP Huzzah32
GND to GND
VCC to 3V
DT to MISO Pin (GPIO19)
SCK to MOSI Pin GPIO 18)
GPIO 5 is the spi clock pin but it´s not connected
I´m using the hx711_spi.py library
The code is as follows:
Code: Select all
from hx711_spi import HX711
from machine import Pin, SPI
pin_OUT = Pin(19, Pin.IN, pull=Pin.PULL_DOWN)
pin_SCK = Pin(18, Pin.OUT)
spi_SCK = Pin(5)
spi = SPI(1, baudrate=1000000, polarity=0,
phase=0, sck=spi_SCK, mosi=pin_SCK, miso=pin_OUT)
hx711 = HX711(pin_SCK, pin_OUT, spi)
hx711.set_gain(128)
hx711.tare()
while True:
value = hx711.get_value()
print(value)
Can you figure what I´m doing wrong?