HX711 Class
- ID: hx711
- Name: 24-bit Analog-to-digital Converter
- Category: electric
- Manufacturer: generic
- Link: http://www.dfrobot.com/image/data/SEN0160/hx711_english.pdf
- Connection: gpio
HX711 is a precision 24-bit analog-to-digital converter (ADC) designed for weight scales and industrial control applications to interface directly with a bridge sensor. This module was tested on the Intel(R) Galileo Gen 2 board.
Methods
HX711
-
data
-
sck
-
gain
HX711 constructor
Parameters:
-
data
NumberDefines the data pin
-
sck
NumberDefines the clock pin
-
gain
NumberDefines the gain factor Valid values are 128 or 64 for channel A; channel B works with a 32-gain factor only
Returns:
read
()
Number
Waits for the chip to be ready and returns a reading
Returns:
Raw ADC reading
setGain
-
gain
Sets the gain factor; takes effect only after a call to read() channel A can be set for a 128 or 64 gain; channel B has a fixed 32-gain factor depending on the parameter; the channel is also set to either A or B
Parameters:
-
gain
NumberDefines the gain factor
readAverage
-
times
Returns an average reading
Parameters:
-
times
NumberDefines how many reading to do
Returns:
Average reading
getValue
-
times
Returns ( readAverage() - OFFSET)
Parameters:
-
times
NumberDefines how many readings to do
Returns:
Current value without the tare weight
getUnits
-
times
Returns getValue() divided by SCALE
Parameters:
-
times
NumberDefines how many readings to do
Returns:
Raw value divided by a value obtained via calibration
tare
-
times
Sets the OFFSET value for the tare weight
Parameters:
-
times
NumberDefines how many times to read the tare value
setScale
-
scale
Sets the SCALE value This value is used to convert the raw data to human-readable data (measurement units)
Parameters:
-
scale
NumberValue obtained via calibration