-5

I am having issues reading weight measurement from HX711 connected to my Orange pi zero using python3.

I found numerous Raspberry pi libs for HX711, and I tried some workarounds to operate with OPI.GPIO rather then RPI.GPIO, but I've had no success.

I am trying to use this lib HX711 Python library and the example from the lib. I edited the lib to import OPI.GPIO and the example file as well. I also append GPIO.setmode(GPIO.BOARD) as I received errors regarding the GPIO mode.

When I run the script I receive the following error, but I still can not figure out what is the problem.

GPIO.setup(self._pd_sck, GPIO.OUT)  # pin _pd_sck is output only
Traceback (most recent call last):
  File "./hx4.py", line 15, in <module>
    hx = HX711(16, 18)
  File "/usr/local/lib/python3.6/dist-packages/hx711/__init__.py", line 61, in __init__
    GPIO.setup(self._dout, GPIO.IN)  # pin _dout is input only
  File "/usr/local/lib/python3.6/dist-packages/OPi/GPIO.py", line 354, in setup
    pin = get_gpio_pin(_mode, channel)
  File "/usr/local/lib/python3.6/dist-packages/OPi/pin_mappings.py", line 80, in get_gpio_pin
    return _pin_map[mode][channel]
KeyError: 16

Could you please help me out with this?

Thank you.

closed as off-topic by Steve Robillard, Milliways, joan, Ingo, Ghanima Jan 7 at 22:54

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be specific to the Raspberry Pi within the scope defined in the help center." – Steve Robillard, Milliways, joan, Ingo, Ghanima
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    This is a Raspberry Pi ONLY site. – joan Jan 7 at 15:33
  • Sorry I am new here and I thought that they are both ARM single board pc dev boards. Where shall I post my question then? Thank you. – Mike Jan 8 at 7:14
  • You need to find an Orange Pi forum for support on the Orange Pi. – joan Jan 8 at 9:08

Browse other questions tagged or ask your own question.