Bath-Biodevices-Without-Borders / Bath-Biodevices-Without-Borders/System

Improve how program determines if water is safe to drink

Open
#13 0 comments 0 reactions 0 assignees View on GitHub
bug enhancement
Dominant language
C++
Stars
1
Forks
2
PR merge metrics
No merged PRs in 30d

Description

# Improve how program determines if water is safe to drink

## Problem

Research needs to be conducted to determine the range of values plus the combination that determine if water is safe to drink.

## Current Operation

The function takes eight parameters: an integer `start_idx` representing the index of the first stable reading, an integer `numOfReadings` representing the number of readings, and six pointers to arrays of floating-point numbers representing the readings from different sensors.

The function starts by defining the minimum and maximum safe values for each sensor. These values are used to determine whether the water is safe. If the mean of the readings for a sensor is between the minimum and maximum values, the water is considered safe for the parameter that sensor is measuring.

Next, the function calculates the mean of the readings for each sensor. It does this by calling the `getMean()` function for each sensor's readings. The `getMean()` function takes three parameters: a pointer to an array of readings, the index of the first stable reading, and the number of readings. It calculates the mean by summing all the readings from the first stable reading to the last reading, and then dividing by the number of these readings.

Once the function has calculated the mean of the readings for each sensor, it checks whether these means are within the safe ranges. If the mean of the readings for all sensors is within the corresponding safe range, the function considers the water to be safe and returns 1. If the mean of the readings for any sensor is not within the corresponding safe range, the function considers the water to be unsafe and returns 0.

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the safety-check function described in the issue and its calls to getMean(). Research the safe ranges and combinations for all six sensor readings before deciding how the criteria should change. Done means the program's safety result reflects the agreed evidence-based ranges and combinations.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.