moisture-detection/README.md
2026-09-02 15:42:09 -06:00

26 lines
821 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# AG-01 — Moisture Collector
Edit **only** `main.c`.
The supplied library reads the detector data, remembers the totals, and prints
the result. In `main.c`, replace the three `0` placeholders in the `if` /
`else if` chain with comparisons using `reading`.
| Reading | Reporting call already in the template |
| :--- | :--- |
| negative | `moisture_record_error(reading)` |
| `0` | `moisture_record_idle()` |
| `1`–`100` | `moisture_record_collect(reading)` |
| greater than `100` | `moisture_record_saturated(reading)` |
Run the supplied demonstration with:
```bash
./run.sh
```
It builds your `main.c` and runs a fixed set of detector readings for you.
Do not edit `api/`. Submit the completed folder when
instructed. The instructor compiles `main.c` with the provided library and
checks it after collection.