New logger & removed old unused files

This commit is contained in:
Martin Bauer
2021-08-10 22:47:47 +02:00
parent 28c85f749c
commit ce12c846f6
18 changed files with 179 additions and 534 deletions

View File

@@ -7,8 +7,10 @@ class Scale
public:
bool measure(uint16_t &measurementOut)
{
long value = hx711_.read_average(CONFIG_MEASUREMENT_AVG_COUNT) - offset_;
Serial.println(value);
long value = hx711_.read_average(CONFIG_MEASUREMENT_AVG_COUNT);
LOG_TRACE("rv %ld\n", value);
value -= offset_;
if (value < 0)
measurementOut = (int16_t)(-(value >> valueRightShift_ ));
else
@@ -24,9 +26,9 @@ public:
void tare(uint32_t numMeasurementsToAverage = 50)
{
hx711_.read_average(3);
auto v1 = hx711_.read_average(3);
offset_ = hx711_.read_average(numMeasurementsToAverage);
Serial.printf("Tare offset %ld\n", offset_);
LOG_INFO("Init reading %ld, Tare offset %ld\n", v1, offset_);
}
const long &offset() const { return offset_; }