Adafruit HX711 Arduino Library
Public Member Functions | List of all members
Adafruit_HX711 Class Reference

Library for the HX711 load cell amplifier. More...

#include <Adafruit_HX711.h>

Public Member Functions

 Adafruit_HX711 (uint8_t dataPin, uint8_t clockPin)
 Construct a new Adafruit HX711 object. More...
 
void begin ()
 Initialize the HX711 module Sets up the pin modes and performs a power reset.
 
bool isBusy ()
 Check if the HX711 is busy. More...
 
void powerDown (bool down)
 Power down or wake up the HX711. More...
 
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. More...
 
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 the HX! More...
 
int32_t readChannelBlocking (hx711_chanGain_t chanGain=CHAN_A_GAIN_128)
 Blocking read value from the specified channel and gain. More...
 
void tareA (int32_t tareValue)
 Set the raw 'tare' offset for channel A. More...
 
void tareB (int32_t tareValue)
 Set the raw 'tare' offset for channel B. More...
 

Detailed Description

Library for the HX711 load cell amplifier.

Constructor & Destructor Documentation

◆ Adafruit_HX711()

Adafruit_HX711::Adafruit_HX711 ( uint8_t  dataPin,
uint8_t  clockPin 
)

Construct a new Adafruit HX711 object.

Parameters
dataPinData pin number
clockPinClock pin number

Member Function Documentation

◆ isBusy()

bool Adafruit_HX711::isBusy ( )

Check if the HX711 is busy.

Returns
true If the HX711 is currently busy (DOUT is high)
false If the HX711 is ready for data retrieval (DOUT is low)

◆ powerDown()

void Adafruit_HX711::powerDown ( bool  down)

Power down or wake up the HX711.

Parameters
downtrue to power down, false to wake up

◆ readChannel()

int32_t Adafruit_HX711::readChannel ( hx711_chanGain_t  chanGain = CHAN_A_GAIN_128)

Read data from the HX711, handling channel and gain setup, and with 'tare' offset.

Parameters
chanGainChannel and gain configuration
Returns
int32_t The signed 32-bit extended raw sensor data

◆ readChannelRaw()

int32_t Adafruit_HX711::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 the HX!

Parameters
chanGainChannel and gain configuration
Returns
int32_t The signed 32-bit extended raw sensor data

◆ readChannelBlocking()

int32_t Adafruit_HX711::readChannelBlocking ( hx711_chanGain_t  chanGain = CHAN_A_GAIN_128)

Blocking read value from the specified channel and gain.

Parameters
chanGainChannel and gain configuration
Returns
int32_t The reading from the sensor

◆ tareA()

void Adafruit_HX711::tareA ( int32_t  tareValue)

Set the raw 'tare' offset for channel A.

Parameters
tareValueSigned i32 that is added to channel A readings

◆ tareB()

void Adafruit_HX711::tareB ( int32_t  tareValue)

Set the raw 'tare' offset for channel B.

Parameters
tareValueSigned i32 that is added to channel B readings

The documentation for this class was generated from the following files: