moisture-detection/main.c
2026-09-02 15:42:09 -06:00

26 lines
659 B
C

#include "api/moisture_detector.h"
int main(void) {
moisture_session_start();
while (moisture_detector_has_next()) {
int reading = moisture_detector_reading();
/*
* Replace each 0 below with a comparison using `reading`.
* The reporting calls are already correct—leave them alone.
*/
if (0) {
moisture_record_error(reading);
} else if (0) {
moisture_record_idle();
} else if (0) {
moisture_record_collect(reading);
} else {
moisture_record_saturated(reading);
}
}
moisture_print_summary();
return 0;
}