ok

Dependencies:   mbed

Fork of g3_waterplay by Mario Simaremare

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SalinitySensor.h Source File

SalinitySensor.h

00001 /*
00002 * G3: WATERPLAY
00003 */
00004 
00005 #ifndef SALINITY_SENSOR_H
00006 #define SALINITY_SENSOR_H
00007 
00008 #include "mbed.h"
00009 #include "Printer.h"
00010 
00011 class SalinitySensor
00012 {
00013 public:
00014     SalinitySensor(
00015         Printer &printer,
00016         PinName pin
00017     );
00018     static const double VIN = 3.3;
00019     static const double CONVERTER = 1.6667;
00020     static const double MULTIPLIER = 16.3;
00021     static const double LOWER_BOUNDARY = 3.0;
00022     static const double UPPER_BOUNDARY = 6.9;
00023     static const int SAMPLING_NUMBER = 100;
00024     void reload();
00025     double getReading();
00026     double getVoltage();
00027     double getSalinity();
00028     double getStatus();
00029     char* getStrStatus();
00030 
00031 private:
00032     Printer &_printer;
00033     AnalogIn _analog_in;
00034     double _reading;
00035     double _voltage;
00036     double _salinity;
00037     double _status;
00038     char* _strStatus;
00039 };
00040 
00041 #endif