Coder Social home page Coder Social logo

Library HX711 about hx711 HOT 7 CLOSED

vejo17 avatar vejo17 commented on July 18, 2024
Library HX711

from hx711.

Comments (7)

bogde avatar bogde commented on July 18, 2024

do you have:

#include "HX711.h"

at the top of your sketch file?

are you using
Hx711 scale(A1, A0);
or
HX711 scale(A1, A0);
?

use HX711 scale(A1, A0);

does the included example (HX711Serial) work?

from hx711.

vejo17 avatar vejo17 commented on July 18, 2024

Hi
I use HX711 scale(A1, A0), but the program send me the next message:sketch_sep08b.ino: In function 'void loop()':sketch_sep08b:12: error: 'class HX711' has no member named 'getGram'.The example (HX711Serial) is working correctly.
Im using this code:#include <HX711.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);HX711 scale(A1, A0);void setup() {lcd.begin(16, 2);}void loop() {lcd.setCursor(0, 0);lcd.print(scale.getGram(), 1);lcd.print(" g");lcd.print(" ");delay(200);} but in the blue line im having a mistake. Can you tell me how to resolve this issue ? Or if i have to use another function?
And thanks for your answer
Date: Sun, 7 Sep 2014 22:30:27 -0700
From: [email protected]
To: [email protected]
CC: [email protected]
Subject: Re: [HX711] Library HX711 (#10)

do you have:

#include "HX711.h"

at the top of your sketch file?

are you using

Hx711 scale(A1, A0);

or

HX711 scale(A1, A0);

?

use HX711 scale(A1, A0);

does the included example (HX711Serial) work?

β€”
Reply to this email directly or view it on GitHub. =

from hx711.

bogde avatar bogde commented on July 18, 2024

there is no method getGram. see here for the methods you can call:
https://github.com/bogde/HX711/blob/master/HX711.h

see the example for a proper usage.

from hx711.

r-a-i avatar r-a-i commented on July 18, 2024

I ran into this issue too.

The documentation on ./README.md says that in the non-blocking mode we should:

// 4. Acquire reading without blocking
if (scale.wait_ready_timeout(1000)) {...

Instead, it should say:

// 4. Acquire reading without blocking
if (loadcell.wait_ready_timeout(1000)) {...

for consistency with the definition at the start of the example
HX711 loadcell;

from hx711.

amotl avatar amotl commented on July 18, 2024

Dear @r-a-i,

may I humbly ask for a pointer where you found this inconsistency? I just skimmed [1]Β and can't find any typo in there.

With kind regards,
Andreas.

[1] https://github.com/bogde/HX711/tree/master/examples

from hx711.

amotl avatar amotl commented on July 18, 2024

may I humbly ask for a pointer

Reading things more concentrated always makes sense. Sorry again for overlooking your reference to README.md.

You are absolutely right. When fixing this, we might also think about making the example in README.md consistent with the example files referenced above, right?

Would you personally prefer scale oder loadcell as the name for a canonical variable name referencing the HX711 object? Technically, just calling it hx711 would also be fine but might confuse newcomers.

... just wanted to mention that I acknowledge we should bring more consistency into the code examples and that I am personally open for any better name if desired.

from hx711.

r-a-i avatar r-a-i commented on July 18, 2024

Dear @amotl, I just submitted a pull request for this change for your consideration.

Personally, I think the variable name "loadcell" is more generic as the "Hx711" is a loadcell amplifier. Some people may use loadcells to build "scales", but not always. In my case, I'm using a loadcell to measure a force directly and not weight.

Thank you for your consideration and all your contributions to this library.

from hx711.

Related Issues (20)

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.