Using pyboard with HX711

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
hoodlum
Posts: 1
Joined: Sat Apr 18, 2020 1:12 pm

Using pyboard with HX711

Post by hoodlum » Thu May 14, 2020 2:55 pm

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?

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Using pyboard with HX711

Post by jimmo » Wed Jun 10, 2020 6:32 am

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.

Post Reply