olkal/HX711_ADC

Problem with LoadCell.tareNoDelay() and LoadCell.getTareStatus()

Opened this issue · 3 comments

Hi,

I understand that tareNoDelay() need to complete in order to return getTareStatus() True, but how can i know if tareNoDelay() is completed?

I have trouble modifying this:
if (Serial.available() > 0) {
if (Serial.available() > 0) {
char inByte = Serial.read();
if (inByte == 't') LoadCell.tareNoDelay();
}
}

I don't want to enter 't' to serial, i want to push a button in order to tare. I spent so much time trying to implement functions in order to work and it does not. Could you help me with this?

olkal commented

Hi!
The function getTareStatus() will return true when the tareNoDelay() process is completed.
Example:

    if (LoadCell.getTareStatus() == true) {
      Serial.println("Tare complete");
    }

To initiate the tare function from a push button input, I suggest that you download the Momentary-switch library https://github.com/olkal/Momentary-Switch and implement it in your sketch. Then call tareNoDelay() when button is released.

This issue is stale because it has been open for 30 days with no activity.

This issue was closed because it has been inactive for 14 days since being marked as stale.