Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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 VARIANCE = 0.0; 00022 static const double LOWER_BOUNDARY = 3.0; 00023 static const double UPPER_BOUNDARY = 6.9; 00024 static const int SAMPLING_NUMBER = 100; 00025 void reload(); 00026 double getReading(); 00027 double getVoltage(); 00028 double getSalinity(); 00029 double getStatus(); 00030 char* getStrStatus(); 00031 bool inBoundary(); 00032 bool inDanger(); 00033 00034 private: 00035 Printer &_printer; 00036 AnalogIn _analog_in; 00037 double _reading; 00038 double _voltage; 00039 double _salinity; 00040 double _status; 00041 char* _strStatus; 00042 bool _in_boundary; 00043 bool _in_danger; 00044 }; 00045 00046 #endif
Generated on Tue Jul 12 2022 19:11:49 by
1.7.2