No description
- C 100%
| api | ||
| .gitignore | ||
| moisture.c | ||
| README.md | ||
Moisture Detection 2
The moisture sensor is back, and now it sends a time with every level.
What is what
| File | |
|---|---|
moisture.c |
Parts B and C: your code goes here, at each YOUR TASK |
api/ |
the sensor library; do not edit it |
What to do
- Part A. In
moisture.c, writeclassify(), then finish the loop inmain(): skip sensor faults and store every other reading intimes[]andlevels[]. Then writecount_in_band(),index_of_max(), andaverage(). You are done when thecheck:line says PASS for./moistureand for./moisture 7. - Part B. Run
./moisture 7 14. Fourteen readings do not fit in ten slots: print the "dropped" line instead of writing past the end.
Build and run
gcc -std=c17 -Wall -Wextra -o moisture moisture.c api/moisture_sensor.c
./moisture
./moisture 7
./moisture 7 14
For Part B, add -fsanitize=address -g to the moisture line.