Page 1 of 1

Using pyboard with HX711

Posted: Thu May 14, 2020 2:55 pm
by hoodlum
I have a pyboard v1.1 and have tried to use it to interface with an HX711 and load cell. This driver https://github.com/SergeyPiskunov/micropython-hx711 indicates it can be used with an ESP8266 controller but nothing about a regular pyboard, I was unable to find a driver that referenced a pyboard and assumed this driver would work.

When trying to set up the driver in REPL I get this error:

Code: Select all

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "hx711.py", line 34, in __init__
TypeError: can't convert 'int' object to str implicitly
Is it possible to use the HX711 with a pyboard and what driver can I use to get it working?

Re: Using pyboard with HX711

Posted: Wed Jun 10, 2020 6:32 am
by jimmo
hoodlum wrote:
Thu May 14, 2020 2:55 pm
When trying to set up the driver in REPL I get this error:
I think this is just because on ESP8266 the pins are numbered, whereas on STM32 they have names.

If you're using the example that comes with that library, it uses Scales(d_out=5, pd_sck=4) --> HX711(d_out, pd_sck).

On STM32/pyboard, you'll need to change it to use d_out='X1', pd_sdk='X2' or similar.