Adafruit HX711 Arduino Library
Adafruit_HX711.h
1 #ifndef Adafruit_HX711_h
2 #define Adafruit_HX711_h
3 
4 #include "Arduino.h"
5 
6 enum hx711_chanGain_t {
7  CHAN_A_GAIN_128 = 25,
8  CHAN_A_GAIN_64 = 27,
9  CHAN_B_GAIN_32 = 26
10 };
11 
16 
17 public:
18  Adafruit_HX711(uint8_t dataPin, uint8_t clockPin);
19  void begin();
20  bool isBusy();
21  void powerDown(bool down);
22  int32_t readChannel(hx711_chanGain_t chanGain = CHAN_A_GAIN_128);
23  int32_t readChannelRaw(hx711_chanGain_t chanGain = CHAN_A_GAIN_128);
24  int32_t readChannelBlocking(hx711_chanGain_t chanGain = CHAN_A_GAIN_128);
25  void tareA(int32_t tareValue);
26  void tareB(int32_t tareValue);
27 
28 private:
29  uint8_t _dataPin;
30  uint8_t _clockPin;
31  int32_t readRawData(uint8_t pulses);
32  int32_t _tareValueA;
33  int32_t _tareValueB;
34 };
35 
36 #endif
int32_t readChannelBlocking(hx711_chanGain_t chanGain=CHAN_A_GAIN_128)
Blocking read value from the specified channel and gain.
Definition: Adafruit_HX711.cpp:41
void tareB(int32_t tareValue)
Set the raw 'tare' offset for channel B.
Definition: Adafruit_HX711.cpp:112
void begin()
Initialize the HX711 module Sets up the pin modes and performs a power reset.
Definition: Adafruit_HX711.cpp:18
Adafruit_HX711(uint8_t dataPin, uint8_t clockPin)
Construct a new Adafruit HX711 object.
Definition: Adafruit_HX711.cpp:9
void tareA(int32_t tareValue)
Set the raw 'tare' offset for channel A.
Definition: Adafruit_HX711.cpp:104
void powerDown(bool down)
Power down or wake up the HX711.
Definition: Adafruit_HX711.cpp:31
bool isBusy()
Check if the HX711 is busy.
Definition: Adafruit_HX711.cpp:98
int32_t readChannel(hx711_chanGain_t chanGain=CHAN_A_GAIN_128)
Read data from the HX711, handling channel and gain setup, and with 'tare' offset.
Definition: Adafruit_HX711.cpp:53
Library for the HX711 load cell amplifier.
Definition: Adafruit_HX711.h:15
int32_t readChannelRaw(hx711_chanGain_t chanGain=CHAN_A_GAIN_128)
Read data from the HX711, handling channel and gain setup, NO tare offset - the 'raw' ADC value from ...
Definition: Adafruit_HX711.cpp:65