23 #ifndef SCALE_H_4B64A868_05B1_4F4C_99CF_E75ED9BAED50
24 #define SCALE_H_4B64A868_05B1_4F4C_99CF_E75ED9BAED50
29 #include "pico/time.h"
93 const int32_t ref_unit,
94 const int32_t offset);
108 const double*
const raw,
109 double*
const normalised);
static const scale_options_t SCALE_DEFAULT_OPTIONS
bool scale_zero(scale_t *const sc, const scale_options_t *const opt)
Zeros the scale (tare) by adjusting its offset from 0 according to the given options....
bool scale_weight(scale_t *const sc, mass_t *const m, const scale_options_t *const opt)
Obtains a weight from the scale according to the given options. Returns true if the operation succeed...
bool scale_get_values_samples(scale_t *const sc, int32_t *const arr, const size_t len)
Fills arr with len number of samples from the scale. Returns true if the operation succeeded.
void scale_options_get_default(scale_options_t *const opt)
Fill options will default values.
bool scale_read(scale_t *const sc, double *const val, const scale_options_t *const opt)
Obtains a value from the scale according to the given options. Returns true if the operation succeede...
void scale_init(scale_t *const sc, scale_adaptor_t *const adaptor, const mass_unit_t unit, const int32_t ref_unit, const int32_t offset)
Initialise the scale with a hx711_t.
bool scale_normalise(const scale_t *const sc, const double *const raw, double *const normalised)
Adjusts a raw value to a normalised value according to the scale's reference unit and offset....
bool scale_get_values_timeout(scale_t *const sc, int32_t *const arr, const size_t arrlen, size_t *const len, const uint timeout)
Fills arr with as many number of samples as possible up to the timeout. Returns true if the operation...
scale_adaptor_t * _adaptor