most functionality to splashdwon, find neutral and start mission. short timeouts still in code for testing, will adjust to go directly to sit_idle after splashdown

Dependencies:   mbed MODSERIAL FATFileSystem

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers omegaPX209.hpp Source File

omegaPX209.hpp

00001 #ifndef OMEGAPX209_HPP
00002 #define OMEGAPX209_HPP
00003 
00004 /*
00005 This class wraps an Omega pressure transducer.
00006 Author: Matthew, October 24th, 2013
00007 Modified: Dan, 2017-10-30
00008 */
00009 
00010 #include "mbed.h"
00011 
00012 #define water_density_kg_m3 1000    // fresh water density [kg/m^3] (1029 for sea water)
00013 #define grav_m_s2 9.80665           // gravitational constant [m/s^2]
00014 
00015 #define m2ft 3.28084                // convert m to ft
00016 #define psi2Pa 6894.76              // convert psi to Pa
00017 
00018 #define OVERSAMPLE 20               // number of oversamples
00019 
00020 class omegaPX209 {
00021 public:
00022     omegaPX209(PinName pin);    
00023     void init();
00024     void tare();                   // tares reading to ambient pressure
00025 
00026     float getPsi();                 // returns pressure [psi]
00027     float getDepthFt();             // returns water depth [ft] 
00028     float getDepthM();
00029     void setZero(float zeroPsi);    // lets user set a different ambient pressure [psi] ... tare, effectively
00030     float getZero();                // returns the internal ambient pressure [psi]
00031     
00032     int readADCCounts();          //06/07/2018 check the outputs
00033     float readVoltage();            //voltage reading?
00034     float getRawPSI();
00035 
00036 private:
00037     AnalogIn _adc;
00038 
00039     float _psi;                     // pressure [psi]
00040     float _zeroPsi;                 // atmospheric pressure at sea level [psi]
00041     float _adcVoltage;              // voltage of mbed ADC system [V]
00042     float _fullscale;               // maximum pressure of the sensor [psi]
00043     float _psi_per_volt_cal;                     // psi per volt calibration [psi/V]
00044     float _PSI_reading;
00045 };
00046 
00047 #endif