Giter Site home page Giter Site logo

hx711py's Introduction

HX711 for Raspbery Pi

This code is credited to underdoeg's gist HX711.py.

I've only made a few modifications on the way the captured bits are processed and to support Two's Complement, which it didn't.

I'm currently trying to improve this version. It's actually working, I'd use hx711v_0_5_1.py.

Warning: Possible random values

Possible random values! Polling the bits from the HX711 is a time sensitive process as explained in the HX711 the datasheet. Raspberry runs on Linux which is not a good tool for time sensitive operations using the GPIO pins because tasks are prioritized by the Operative System which might delay a GPIO operation, causing the library to fail to poll the bits following the specified timing in the datasheet. It could also happen that the commands that poll the pins up and down run too fast for the HX711.

If there is a right way to precisely poll the bits with a Raspberry Pi (i.e. Linux OS) following the datasheet's timing specifications, which is in microseconds, which is a millionth of a second, then this code is probably not doing it in that right way and might return random values if other processes are running simultanously, delaying the GPIO operations, or if the processor is not busy with anything else at all, allowing the GPIO operations to happen too fast.

I know very little about OS architecture, but it seems to me that this two scenarios could happen. I'm not event a developer as you can see by how ugly the code and my commits are, so I'd think twice before trusting this code, haha.

I'm think that a better idea is to wire the HX711 to an MCU and the MCU to the Raspberry Pi. The MCU could poll a pin to trigger an event on the Raspberry Pi so that the Pi could retrieve the data from the MCU using 1-Wire or I2C, probably. Maybe a feature for the future.

So, at the risk of repeating myself, I do recommend using an Arduino or any MCU instead of a Raspberry Pi to poll bits from the HX711. and if you really need an Raspberry involved, then have the Arduino send the information to the Raspberry Pi vía I2C or 1-Wire. Hope this library helps, though.

Table of contents

  1. Files description
  2. Instructions
  3. Usage with two channels
  4. Changelog

Files description

File descriptions:

  • hx711.py: v0.1 code. Readings are not near as frequent as they could be. Currently, it's barely doing 1 reading per second when the HX711 allows for 10SPS (Samples Per Second), which translates to 10 readings per second.
  • example.py: Example of how to use hx711.py. The exaplanation is not good at all.
  • hx711_emulator.py: This is a class that emulates the behaviour of my original HX711 class. It's actually more a simulator than an emulator.
  • example_emulator.py: Show an example but using the emulator class.
  • hx711v0_5_1.py: This a new version I've just created, tested and working pretty well, with the objective of allowing 10 readings per second. They will be provided by some sort of event I still need to figure out how to create and how to throttle somehow.
  • example_hx711v0_5_1.py:

Instructions

New Version

No "setup.py" required if you're on Raspbian OS. I'm actually using the Lite Version without GUI to avoid processes messing up with the bit polling process.

Interrupt based

clone [email protected]:tatobari/hx711py.git
python example_hx711v0_5_1.py

Interrupt based

Polling based

clone [email protected]:tatobari/hx711py.git
python example_hx711v0_5_1.py --polling-based

Interrupt based

Legacy Version

To install the old version (hx711.py):

clone [email protected]:tatobari/hx711py.git
python setup.py install
python example.py

About using the two channels of one breakout board

This is a completely unnecessary feature that I, for some reason, decided to include in the original code. Anyway, in theory, it allows using two loadcells at the same time but they would have different two gains. So, though they would provide different raw values, both provide weights, just with different accuracy.

I haven't tested the use of two loadcells on the same breakout board at the same time. It might not work.

Channel A has selectable gain of 128 or 64. Using set_gain(128) or set_gain(64) selects channel A with the specified gain.

Using set_gain(32) selects channel B at the fixed gain of 32. The tare_B(), get_value_B() and get_weight_B() functions do this for you.

This info was obtained from an HX711 datasheet located at: https://cdn.sparkfun.com/datasheets/Sensors/ForceFlex/hx711_english.pdf

Changelog

03/03/2023

  • Changed the filename of the new version to make a bit more sense (Sorry for not making a new branch for the new verison.).
  • Added example file for v0.5.1.
  • Added GIF examples of new library to README.md.
  • Added example commands to README.md.
  • Tested v0.5.1 and working.

28/02/2023

I'm only using my lunch time to commit changes in order to close all the HX711 environment on my mac because I need more processing power.

This version adds new methods to allow the use of interrupts as an alternative to polling.

25/02/2023

Funily enough and by pure accident, exactly two years after updating the README.md file with false promises, I'm back making a few changes.

My motivation to update this code is to improve the reading frequency.

25/02/2021

For the past years I haven't been able to maintain this library because I had too much workload. Now I'm back and I've been working on a few fixes and modifications to simplify this library, and I might be commiting the branch by mid-March. I will also publish it to PIP.

hx711py's People

Contributors

bobbylindsey avatar carlosbarilatti avatar neonspork avatar slabula avatar tatobari avatar woodyjon avatar yesrod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hx711py's Issues

Getting kilograms from the code

Hello Tato
Thank you for your script. I am doing a calibration as well, and I have some troubles with my output since a get large signal value output interval from the raspberry 3. I have been calculating the signal values to kg, by using the linear equation y = ax + b.

But unfortunately, I get signal values from 28687 to -1508217, wich corresponds to -0.4 kg and 24 kg wich should not accrue since I only was adding 2.6 kg to my loadcell.

BTW: I chanced getweigth(5) to getweigth(1) and out commented I also commented out the power_down, power_up, and the time.sleep in example.py

Hope you can help:)

Help with Troubleshooting Issue

Hi Tato

Thank you so much for offering to help. I am using Pi 2 Model B. I have connected the Hx711 as follows:
VCC - 3v3
GND - Ground
CLK - GPIO23
DATA - GPIO24

output

I've only changed line 140 in the code to: hx = HX711(23, 24)
After running it with "sudo python hx711.py" I get the following output

wiring setup

It appears to be very erratic. I have also tried to switch the CLK and DATA pins around and I get the value "18.23" constantly even with the addition of a weight. Thanks again

Regards

setuptools install hx711 err

when i exec python3 setup.py install command,an error has occurred

source/py_gpio.c:87:4: error: function definition is not allowed here
   {
   ^
source/py_gpio.c:143:10: warning: implicit declaration of function 'cleanup_one' is invalid in C99 [-Wimplicit-function-declaration]
         cleanup_one();
         ^
source/py_gpio.c:143:10: warning: this function declaration is not a prototype [-Wstrict-prototypes]
source/py_gpio.c:172:13: warning: implicit declaration of function 'cleanup_one' is invalid in C99 [-Wimplicit-function-declaration]
            cleanup_one();
            ^
source/py_gpio.c:200:24: error: function definition is not allowed here
   int setup_one(void) {
                       ^
source/py_gpio.c:293:13: warning: implicit declaration of function 'setup_one' is invalid in C99 [-Wimplicit-function-declaration]
       if (!setup_one())
            ^
source/py_gpio.c:293:13: warning: this function declaration is not a prototype [-Wstrict-prototypes]
source/py_gpio.c:323:12: warning: implicit declaration of function 'setup_one' is invalid in C99 [-Wimplicit-function-declaration]
      if (!setup_one())
           ^
source/py_gpio.c:345:21: error: function definition is not allowed here
   int output(void) {
                    ^
source/py_gpio.c:419:18: error: called object type 'PyObject *' (aka 'struct _object *') is not a function or function pointer
      if (!output())
           ~~~~~~^
source/py_gpio.c:475:18: error: called object type 'PyObject *' (aka 'struct _object *') is not a function or function pointer
      if (!output())
           ~~~~~~^
6 warnings and 5 errors generated.
error: Setup script exited with error: command 'gcc' failed with exit status 1

i want to know ,how to solve it?

Having problem on assigning variables

Hi mr.tatobari,
forgive my ignorance
I am having trouble on assigning variable to get an initial data using my 20kg Load cell bar
and HX711
I copied one of your lines and made a test run.
I got a message of syntax error. Is the "val" the only variable i can use?
I am trying to get a percentage ratio from the initial weight and the current weight but still do not
have an answer for almost 3weeks.

This here is one of the lines i am using in my RPi3

try:
    val = max(0, int(hx.get_weight(5)))
    mylcd.lcd_display_string("Load={0:0.1f}g" .format(val),2)
    hx.power_down()
    hx.power_up()
    print(val)
    val2 = hx.get_weight(5)
    mc = (1 - (val2-val)/val2) * 100
    mylcd.lcd_display_string("MC={0:0.1f}%" .format(mc),4)

except (KeyboardInterrupt, SystemExit):
    cleanAndExit()

P.S your codes and lines are being used in education not on any kind to get an income
P.P.S specifically, on my thesis project

I am hoping and wishing to get a response. Big thanks for even noticing me.

wiring 4 load sensors in a full wheatstone bridge config

Hello,

I am in the process of building a weight scale which consists of:

4 load cells connected in a full bridge config as shown in: https://i.stack.imgur.com/9vDyI.jpgHX711Raspberry Pi

I have not been able to find a code to run in my Rs Pi (python or C). Has anyone worked on this or know where I can find the code?

Note1) I am hoping to get the final values in kg or g, and do a little bit calibration for my system at the end.

Note2) I have found a C code which is written for a single bar load cell connected to HX711 - Rs Pi, and tried running it directly. I get 0 values initially without any load and the output does increase with increasing force applied, though the scale is way off (~100g output when I press on the scale hard).

greatly appreciated!

diffrent values when auto run this script on boot/login

Hi I plan to run this script on boot and use the printed value in CODESYS.

When I run this script in the Pi Desktop view via remote control on windows or in Putty, everything is fine. But when I auto start this on boot/login, I get random numbers between -800 and + 1200 for exsample after the tare.
While having the start command in the "sudo nano /etc/profile" file to auto start it, I also get the random rumbers in Putty after stoping the script and starting it manuell again.

2Unbenannt

But when I remove the line in the profile, starting the script manuelly in Putty has nu issue and the numbers are fine.

image

It looks like the issue when having the referenceUnit = 1. When I changed the referenceUnit to 424, my printed values are pretty accurate. Also I power the the hx711 with 3.3V. I use only one load cell.

Unbenannt

Also, when I change the GPIOs, I still get the same error message you see in the screenshot. This message I get also when I start it manually in shell directly on the pi (without Putty). Is this error a/the problem?

What might be the reason?

reading data problem

can you please help me...
sometimes it works and it is showing real data. 😃
but most of the time it is something like this... it starts with small negative number and decrease...
i can put weight like on attachment but it is still decreasing. 😢
screen shot 2016-09-29 at 22 22 45

Getting the first weight value aside from tare value

Hi sir tatobari,

Do you have some way to get the first initial mass from the code?
like.. after the Tare where the value is 0, then you suddenly lumped in a 3kg you get to record and save the 3kg value sensed by the loadcell to be used in equation like these:

MC = (1-(initial mass - present mass)/initial mass) * 100

Ive tried this code and got myself a 1% because of lack of initial mass value:
image

Reference unit and settings

Hello, and I appreciate any help I can get.
I am using 4 degraw 50kg sensors. Using Standard example.py, I have only changed the reference unit, and commented read long and uncommented get weight. Also tried playing with uncommenting hx.tare().

As I’m completely new to python I am pretty sure I am doing something wrong and need clarification.

  1. Should hx.tare be commented or uncommented, or changed after calibrating? I only ask because comments on SparkFun page said they had to uncomment to get it to work.

  2. Should calibration be done using read long or get weight?

Using get weight I get readings of around 32,000 with no weight, and that does not change when I add weight. Changing reference unit can bring that number down, but will still not read weight.

Again I appreciate any help or clarification for my troubleshooting. Been trying to figure this out for two days but some information on other sites has confused me.

Multiple instances gives AttributeError

I want to read the values from 3 separate load cells, each with its own HX711. I need the weight value to stay the same from each reading, or basically, I need to read the values from each load cell without tareing them. Is there a way to do this without having multiple HX711 instances?

(Example code only shows two instances)

from hx711 import HX711
hx1 = HX711(5, 6)
hx1.set_reading_format("MSB","MSB")
hx1.set_reference_unit(687)
hx1.tare()
hx1.power_down()
hx2 = HX711(7, 8)
hx2.set_reading_format("MSB","MSB")
hx2.set_reference_unit(687)
hx2.tare()
hx2.power_down()

if selectedlc == 1:
    hx1.power_up()
    intWeight = hx1.get_weight(5)
    hx1.power_down()
if selectedlc == 2:
    hx2.power_up()
    intWeight = hx2.get_weight(5)
    hx2.power_down()

Wiring of load cells

First off let me thank you for the great code! Worked fine after my son figured out the schematic was wrong on Amazon. Be careful out there. Attached is correct one.
714HHy7QEYL SL1500

My son is using this to monitor weight placed on a structure that sends an MQTT message when weight reaches over X amount. He used 4 50Kg load cells and some rubber crush pads to get upto 500lbs.

Wiring the HX711 to a raspberry pi

I am confused on how to attach from the HX711 to the raspberry pi. In the example code the line
hx = HX711(5, 6)
Makes me believe that DAT and CLK are connected to pin 5 and 6 respectfully. But which ones are pin 5 and 6? Because it seems like pin 5 is SCL and 6 is GND which I doubt is correct.

Thanks
Karl

example.py comments

I am new to coding and really appreciate you sharing this content. Looking at "example.py"; would it be possible to comment what each of the lines does? For example, trying to understand what "EMULATE_HX711=FALSE" does..

Python application stuck on is_ready function

I've an application developed in Python and i'm using hx711.py source code to import the HX711 class, after importing, i'm getting stuck on return GPIO.input(self.DOUT) == 0 . I tried running the example.py code and also had the same error: MYPATH/hx711py/hx711.py", line 51, in is_ready return GPIO.input(self.DOUT) == 0

Is this a hardware error or a software error? I checked HX711 module board VCC and it was receiving 4.85V, that's ok, but I think DOUT is on level HIGH.

HX711 readings

Tatobari,

So I was wondering if you knew a way to speed up how fast it takes readings, because I had read that it should be able to take about 80 readings per second. Yet I can only get about 2 readings per second. So if there is anything that I can do to get the amount of readings to be much higher it would be highly appreciated.

Update: I changed the argument in the get_weight method to 1 instead of 5 and now I can get 6 readings per second. I also commented out the power_down, power_up, and the time.sleep parts. Also I am using a Raspberry Pi Zero if that helps

Thanks
Karl

Getting zero value from Jetson Nano

Hi

When i use HX711 and 4 load cell for my project with Jetson Nano 4GB, i'm getting zero value, however same wiring method with arduino nano or RPi 4 it works. I'm wondering is this library not compatible with Jetson Nano?

No tare

Dear,
I am looking for a change in the program. Once the scale is set, tare is known, it should run at startup without rescale. Is it possible to change this?

Inconstant value returned

First off let me say thanks for the code. However am still getting inconstant values.

A typical measurement looks as follows:
-30217
-30187
2742472
2742470
-30228
-30231
645318
-30186
2742424
-20956
-29201
-30305
-30259

When I use the exact same setup with https://github.com/ggurov/hx711 which is written in C. I don't have the issue. However it's C and is going to be a pain to get that into flask. Any advice/solution?

Giving Random Values

My Hx711 and Load Cell works fine with Arduino Uno (giving outputs with +-4 grams of fluctuations ).
But when I run example.py on my Rpi with following connection:
DT>>5
SCK>>6
VCC>>5V
GND>>GND(RPi 3B+)

I'm getting random values even when nothing placed on load cell.

I get the following result when I run example.py with nothing placed on the Loadcell:


-3939697
-4791665
123791
-1186929
-859249
-4595057
-1252465
-3546225
-7150961
-3808625
-7019889
-4529521
-7478641
-8854897
-4005233
-7609713
-7347569
-9706865
-6888817
-6692209
3859087
-73073
3138191
320143


Plz Help !!!

I'm using python2.7 to run example.py which comes pre installed on Raspbian which is running on my RPi 3B Plus

remember zero point

Hello everybody, I've broken my head for days

I have a Pi3 with HX711

Meanwhile, I've got the balance as a service and loads the values sent via UDP.

Now I have only one problem the balance reset after each restart and that must not be.
Bottles are measured by weight. These bottles can not be taken off the balance every time the machine is restarted but must remain permanently on it.

#!/usr/bin/env python
import time
import sys
import os
import socket
from hx711 import HX711

def cleanAndExit():
    client.disconnect();
    print "Cleaning..."
    GPIO.cleanup()
    print "Bye!"
    sys.exit()

hx = HX711(27, 17)
hx.set_reading_format("LSB",)

hx.set_reference_unit(92)

hx.reset()
hx.tare()

UDP_IP = "192.168.210.113"
UDP_PORT = 1234

while True:
    try:
        val = hx.get_weight(5)
        print val

   val2 = str(val)
        MESSAGE = "GewichtGas="+ val2
   sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
   sock.sendto(MESSAGE, (UDP_IP, UDP_PORT))

        hx.power_down()
        hx.power_up()
        time.sleep(0.5)
    except (KeyboardInterrupt, SystemExit):
        cleanAndExit()

How to tare & define 1kg

ello Tato,

thanks for providing your code and explanation,
but I’m still struggling with a few things.

First: Can you please explain how to evaluate the tare value and the value for the defined (1kg)

Second: Maybe depended on above

With changing the Vcc to 3,3 V the results get better, but still a very inconstant.
My scale consists out of 4 Load Cells which are linked as Wheatstone Bridge.
(tare & 1kg as in our example)

e.g.
Empty scale:
pi@raspberrypi:/scale/hx711 $ python hx.py
0.000
1.076
-0.043
4.500
-0.033
0.000
-0.033
0.000
0.022
-0.022
-0.033
0.022
-0.011
-0.011
-0.022
^CCleaning...
Bye!
pi@raspberrypi:
/scale/hx711 $ python hx.py ## with 1kg
0.000
0.043
0.043
0.033
18.261
0.011
0.196
0.022
0.087
0.087
0.000
0.011
^CCleaning...
Bye!
pi@raspberrypi:~/scale/hx711 $ python hx.py ##wtih 5kg

0.000
0.022
0.033
0.033
0.076
0.043
0.043
0.065
-0.011
0.022
0.033
^CCleaning...
Bye!
pi@raspberrypi:~/scale/hx711 $

Any idea or advice?

Thanks
u-l-m-i

Random values on Jetson nano

@tatobari hx711 for raspberryPi working Fine.
Same code with hx711 -for jetson nano getting random values on adding or removing weight.
I am stuck here. Could you please help?
board used - Jetson nano developer kit, load cell -5kg, HX711

resolution?

Hello,

I am fairly new at this and this HX711 code has worked best for me so far. However, is there a place that i can change the resolution? for some reason my output is only in integers, it doesnt show decimals in any amount of places (looking for atleast 2 decimal places).

Thanks

changing the hx.set_reference_unit() value in example.py doesn't do anything

I'm working with a 3kg load cell and when I run example.py with hx.set_reference_unit(1)
it outputs:

55372
55334
55426
55433
55350
55411
55342
55459
55441
55514
55469
55432
55462
55399

adding 2kg to the load cell changes the output to:

1347015
1347079
1347217
1347085
1347154
1347143
1347165
1347071
1347179
1347080
1347089
1347133
1347182
1346994
1347174
1347168
1347150
1347136
1347186
1347048
1347081
1347139
1347240

i used hx.set_reference_unit(673) since 1347126 / 2000 = 673
but the output does not change after running
please help :(

hx no attribute: get_np_arr8_string() (line 58 on example.py)

I'm trying to troubleshoot my sporadic spiking +/- values. Using example.py's debugging with MSB and LSB, uncommenting the hx.get_np_arr8_string() causes an error that this is not an attribute of hx. Do I need numpy installed to use this library?

Thank you,

Toby

No attribute get-np_arr_8_string

Hi,

I am currently using your library to use some loadcells with a Raspberry Pi 4+.
The values I get are super random so I want to debug the values of MSB en LSB.

According to your code in ' example.py' there should be two functions called 'get_np_arr8_string()' and ' get_binary_string()'. Both functions are not available.
Could you add them in the library?

HX711 Read 0 upon connecting VCC/VDD to power rail but gives output when not connected to Power

Hi, I'm trying to combine the signal 4 S-beam 5-wire load cells (E+,E-,S+,S-,Sh) into a junction box (Output: E+,E-,S+,S-,Sh), amplify the data through HX711 and into the RPi. Wiring diagrams are as below. After wiring and running the code, the output data keeps being 0 or 1 and sometimes fluctuates to 1000/2000 and dropped back to 0/1 every time I connect VCC and/or VDD to power (3.3V/5V). However, if I disconnect the VCC and VDD, the output read around -833000... In both cases the output doesn't react to the applied weight onto the load cell.
IMG_20211123_215657_120
I wasn't sure what was going on. I'm using BCM mode and GPIO pin 5 for DATA and 6 for CLK. So far, I've tried:

  1. switch voltages 3.3V/5V for each at a time AND both at a time for VCC and VDD (output from HX711)
  2. Switch setmode to BOARD
  3. Switch pins 5 and 6 to serial pins( 2 for DATA and 3 for CLK)

According to the datasheet, the S-beam load cells work with voltage up to 10V but the supplier's tech support said that it should still work with 5V, just with less accuracy and requires more tuning. Can you please help me verify what's going on?

'HX711' object has no attribute 'get_weight'

Hello everyone,

I tested your programm, but i have a error: AttributeError: 'HX711' object has no attribute 'get_weight'.

What have i done wrong? Can someone help me.

Thank you

Random values

Hello, I am getting random values so I followed the comment
#If you're experiencing super random values, change these values to MSB or LSB until to get more stable values.
if I am right it means we can only change the values between MSB and LSB in Line 34 hx.set_reading_format("MSB", "MSB")

In later comment #According to the HX711 Datasheet, the second parameter is MSB so you shouldn't need to modify it.
so I did not changed 2nd parameter and tried with hx.set_reading_format("LSB", "MSB")
still I get random values. I tried changing power source to 3.3 V as i read in one of the solved issue.

Please help me I am really determined to do it.

Random Values on the raspberry pi

Im trying to implement this code with the Raspberry pi 4b, on python3. It is giving random values, I tried switching between MSB/LSB, I tried all combinations of the load cell wires to check if there is a difference between the supported formats of hx711 and the load cell that I have. I am not able to debug from the code because the binary values array function doesnt exist. Can you help me understand what mistakes I might be making.
hx711issue4
hx711issue3
hx711issue2
hx711issue1

From the sensor I have taken the red and black to E+ and E-, The green and white as A+ and A-.

Please help me im stuck on this for quite a while I need to figure out a solution for delivery as soon as possible. Any help would be appreciated!

Potential danger wiring HX711 to 5V w Raspberry Pi

Hi,

I believe it is not ideal to indicate that the HX711 should be connected to 5V. That is totally fine with an Arduino, but probably unsafe with the RPi.
I am not sure what exactly might happen, but the RPi (especially older ones, I guess?) might get damaged in the process.

I will be linking this conversation: https://forums.raspberrypi.com/viewtopic.php?t=335497.

"Arduino UNO's GPIOs maximum current is rated at 40mA at 5V, whereas RPi's is 3.3V at 16mA."
Thus, making the HX711 run at 5V with the RPi might not be safe.

Unless... am I missing something?

Is it possible to connect multiple sensors to a single pi with this code?

Hi,

The code works great for a single hx711 connected to one pi.

I am trying to connect multiple load sensors to a single pi and I am just wondering is it possible to do this by changing part of this code?

I have tried creating a new instance like hx711(8,9) where 8 and 9 are the corresponding pins connecting to the hx711 but this does not seem to be working. I am very new to all of this so I could be doing it completely wrong.

Ideally I would like to be able to connect 4+ sensors but even if I could connect 2 simultaneously then that would be great.

Thanks

wrong calculation of the arithmetic mean?

Hello,

In case of an even number, to get the arithmetic mean of the two middle values, shouldn't it be:

midpoint = len(valueList) // 2
return sum(valueList[midpoint-1:midpoint+1]) / 2.0

instead of:

midpoint = len(valueList) / 2
return sum(valueList[midpoint:midpoint+2]) / 2.0

return sum(valueList[midpoint:midpoint+2]) / 2.0

?

How to change GPIO pins

I was just wondering where in the code you can change the GPIO pins you are using. I see that in the initialization of the hx711 class it is setting some settings for GPIO, but I'm not sure those are the pins.

On a related note, would there be any issue with changing the pins to any other numbers? I'm wanting to run multiple load cells out of one Pi and so I was hoping I could do multiple groups like 1,2,3,4 and then 5,6,7,8 for the next one and so on. Would the library still be able to correctly read from these?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.