|
Nol.A SDK Library 26.11.2
For IoT System Software Development
|
Nol.A library for digital weight scale based on HX711. More...
#include <HX711.hpp>
Public Member Functions | |
| Hx711 (uint8_t pin_din, uint8_t pin_slk) | |
| Bind the data-output pin (pin_din) and serial-clock pin (pin_slk). | |
| void | begin () |
| Configure GPIO, zero using 32 samples, and set the default scale of 742. | |
| int32_t | getMilligram () |
| Return one calibrated sample in milligrams using (raw - offset) * 1000 / scale. | |
| int32_t | getAveragedMilligram (uint8_t times=32) |
| Return an averaged calibrated reading in milligrams. | |
| void | setOffset (int32_t offset) |
| Set the raw ADC count subtracted before scaling. | |
| int32_t | getOffset () |
| Return the current zero-load offset in raw ADC counts. | |
| void | setScale (int32_t scale=742) |
| Set the calibration divisor in ADC counts per gram. | |
| int32_t | getScale () |
| Return the current calibration divisor in ADC counts per gram. | |
| void | adjustZero () |
| Average 32 raw samples and store the result as the zero-load offset. | |
Nol.A library for digital weight scale based on HX711.
Blocking HX711 load-cell reader with offset and scale calibration. Reads wait indefinitely for data-ready. Call begin() with the scale unloaded.
| int32_t Hx711::getAveragedMilligram | ( | uint8_t | times = 32 | ) |
Return an averaged calibrated reading in milligrams.
| times | Number of raw samples to average; must be greater than zero. |
| void Hx711::setOffset | ( | int32_t | offset | ) |
Set the raw ADC count subtracted before scaling.
| offset | Zero-load ADC offset. |
| void Hx711::setScale | ( | int32_t | scale = 742 | ) |
Set the calibration divisor in ADC counts per gram.
| scale | Nonzero divisor, default 742; the driver does not validate it. |