API for the HX711 Analog-to-Digital Converter.
More...
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.
|
synchronized void | delete () |
|
| HX711 (short data, short sck, short gain) |
|
| HX711 (short data, short sck) |
|
long | read () |
|
void | setGain (short gain) |
|
void | setGain () |
|
long | readAverage (short times) |
|
long | readAverage () |
|
double | getValue (short times) |
|
double | getValue () |
|
float | getUnits (short times) |
|
float | getUnits () |
|
void | tare (short times) |
|
void | tare () |
|
void | setScale (float scale) |
|
void | setScale () |
|
HX711 |
( |
short |
data, |
|
|
short |
sck, |
|
|
short |
gain |
|
) |
| |
HX711 constructor
- Parameters
-
data | Defines the data pin |
sck | Defines the clock pin |
gain | Defines the gain factor Valid values are 128 or 64 for channel A; channel B works with a 32-gain factor only |
float getUnits |
( |
short |
times | ) |
|
Returns getValue() divided by SCALE
- Parameters
-
times | Defines how many readings to do |
- Returns
- Raw value divided by a value obtained via calibration
double getValue |
( |
short |
times | ) |
|
Returns (readAverage() - OFFSET)
- Parameters
-
times | Defines how many readings to do |
- Returns
- Current value without the tare weight
Waits for the chip to be ready and returns a reading
- Returns
- Raw ADC reading
long readAverage |
( |
short |
times | ) |
|
Returns an average reading
- Parameters
-
times | Defines how many reading to do |
- Returns
- Average reading
void setGain |
( |
short |
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 | Defines the gain factor |
void setScale |
( |
float |
scale | ) |
|
Sets the SCALE value This value is used to convert the raw data to human-readable data (measurement units)
- Parameters
-
scale | Value obtained via calibration |
Sets the OFFSET value for the tare weight
- Parameters
-
times | Defines how many times to read the tare value |
The documentation for this class was generated from the following file:
- /var/lib/jenkins/workspace/upm-doc-stable/build-33/src/hx711/HX711.java