Mario Simaremare / Mbed 2 deprecated g3_waterplay

Dependencies:   mbed

SalinitySensor.h

Committer:
mariosimaremare
Date:
2016-06-14
Revision:
2:ed17e258da0d
Parent:
1:f448c12d2c5b
Child:
3:7c648d1d8802

File content as of revision 2:ed17e258da0d:

/*
* G3: WATERPLAY
*/

#ifndef SALINITY_SENSOR_H
#define SALINITY_SENSOR_H

#include "mbed.h"

class SalinitySensor
{
public:
    SalinitySensor(
        mbed::Serial &serial,
        PinName pin,
        double const_voltage,
        double const_converter,
        double const_multiplier,
        double const_lower_boundary,
        double const_upper_boundary
    );
    void reload();
    double getReading();
    double getVoltage();
    double getSalinity();
    double getStatus();

private:
    Serial &_serial;
    AnalogIn _analog_in;
    double _const_voltage;
    double _const_converter;
    double _const_multiplier;
    double _const_lower_boundary;
    double _const_upper_boundary;
    double _reading;
    double _voltage;
    double _salinity;
    double _status;
};

#endif