Open Storm
Macros | Functions | Variables
atlas_wq_sensor.h File Reference

Declares functions for Atlas water quality sensors. More...

#include "project.h"
Include dependency graph for atlas_wq_sensor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CONDUCTIVITY   100
 
#define TEMPERATURE   102
 
#define DO   97
 
#define ORP   98
 
#define PH   99
 
#define ATLAS_MAX_ITER   100
 

Functions

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...
 

Variables

struct {
   float   ec
 
   float   tds
 
   float   sal
 
   float   sg
 
con_reading
 

Detailed Description

Declares functions for Atlas water quality sensors.

Author
Abhiramm Mullapudi and Matt Bartos
Version
TODO
Date
2017-06-19

Function Documentation

int atlas_sensor_calibrate ( uint8  sensor_address)

Calibrate Atlas sensor using single-point method.

Parameters
sensor_addressI2C slave address of sensor
Returns
1 on success
int atlas_sensor_sleep ( uint8  sensor_address)

Put Atlas I2C sensor into sleep mode.

Parameters
sensor_addressI2C 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
readingStruct for conductivity reading (to be written to)
Returns
1u on success, and 0u otherwise.

Here is the caller graph for this function:

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_addressI2C slave address of sensor
readingValue of reading (to be written to)
Returns
1u on success, and 0u otherwise.

Here is the caller graph for this function:

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
labelsArray to store labels corresponding to each sensor reading
readingsArray to store sensor readings as floating point values
array_ixArray index to label and readings
max_sizeMaximum size of label and reading arrays (number of entries)
Returns
(*array_ix) + number of entries filled

Here is the call graph for this function:

Here is the caller graph for this function: