Declares functions for Atlas water quality sensors.
More...
#include "project.h"
Go to the source code of this file.
|
#define | CONDUCTIVITY 100 |
|
#define | TEMPERATURE 102 |
|
#define | DO 97 |
|
#define | ORP 98 |
|
#define | PH 99 |
|
#define | ATLAS_MAX_ITER 100 |
|
|
int | atlas_sensor_sleep (uint8 sensor_address) |
| Put Atlas I2C sensor into sleep mode. More...
|
|
int | atlas_sensor_calibrate (uint8 sensor_address) |
| Calibrate Atlas sensor using single-point method. More...
|
|
uint8 | atlas_take_single_reading (uint8 sensor_address, float *reading) |
| Take a single reading from Atlas sensor in I2C mode. Used for Temperature, DO, ORP and PH. More...
|
|
uint8 | atlas_take_con_reading (con_reading *reading) |
| Take a single reading from Atlas sensor in I2C mode. Used for conductivity sensor. More...
|
|
uint8 | zip_atlas_wq (char *labels[], float readings[], uint8 *array_ix, uint8 max_size) |
| Inserts current values of water quality measurements into labels and readings arrays. More...
|
|
|
struct { |
float ec |
|
float tds |
|
float sal |
|
float sg |
|
} | con_reading |
|
Declares functions for Atlas water quality sensors.
- Author
- Abhiramm Mullapudi and Matt Bartos
- Version
- TODO
- Date
- 2017-06-19
int atlas_sensor_calibrate |
( |
uint8 |
sensor_address | ) |
|
Calibrate Atlas sensor using single-point method.
- Parameters
-
sensor_address | I2C slave address of sensor |
- Returns
- 1 on success
int atlas_sensor_sleep |
( |
uint8 |
sensor_address | ) |
|
Put Atlas I2C sensor into sleep mode.
- Parameters
-
sensor_address | I2C slave address of sensor |
- Returns
- 1 on success
uint8 atlas_take_con_reading |
( |
con_reading * |
reading | ) |
|
Take a single reading from Atlas sensor in I2C mode. Used for conductivity sensor.
- Parameters
-
reading | Struct for conductivity reading (to be written to) |
- Returns
- 1u on success, and 0u otherwise.
uint8 atlas_take_single_reading |
( |
uint8 |
sensor_address, |
|
|
float * |
reading |
|
) |
| |
Take a single reading from Atlas sensor in I2C mode. Used for Temperature, DO, ORP and PH.
- Parameters
-
sensor_address | I2C slave address of sensor |
reading | Value of reading (to be written to) |
- Returns
- 1u on success, and 0u otherwise.
uint8 zip_atlas_wq |
( |
char * |
labels[], |
|
|
float |
readings[], |
|
|
uint8 * |
array_ix, |
|
|
uint8 |
max_size |
|
) |
| |
Inserts current values of water quality measurements into labels and readings arrays.
- Parameters
-
labels | Array to store labels corresponding to each sensor reading |
readings | Array to store sensor readings as floating point values |
array_ix | Array index to label and readings |
max_size | Maximum size of label and reading arrays (number of entries) |
- Returns
- (*array_ix) + number of entries filled