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

omegaPX209/omegaPX209.hpp

Committer:
joel_ssc
Date:
2019-05-13
Revision:
92:52a91656458a
Parent:
85:dd8176285b6e

File content as of revision 92:52a91656458a:

#ifndef OMEGAPX209_HPP
#define OMEGAPX209_HPP

/*
This class wraps an Omega pressure transducer.
Author: Matthew, October 24th, 2013
Modified: Dan, 2017-10-30
*/

#include "mbed.h"

#define water_density_kg_m3 1000    // fresh water density [kg/m^3] (1029 for sea water)
#define grav_m_s2 9.80665           // gravitational constant [m/s^2]

#define m2ft 3.28084                // convert m to ft
#define psi2Pa 6894.76              // convert psi to Pa

#define OVERSAMPLE 20               // number of oversamples

class omegaPX209 {
public:
    omegaPX209(PinName pin);    
    void init();
    void tare();                   // tares reading to ambient pressure

    float getPsi();                 // returns pressure [psi]
    float getDepthFt();             // returns water depth [ft] 
    float getDepthM();
    void setZero(float zeroPsi);    // lets user set a different ambient pressure [psi] ... tare, effectively
    float getZero();                // returns the internal ambient pressure [psi]
    
    int readADCCounts();          //06/07/2018 check the outputs
    float readVoltage();            //voltage reading?
    float getRawPSI();

private:
    AnalogIn _adc;

    float _psi;                     // pressure [psi]
    float _zeroPsi;                 // atmospheric pressure at sea level [psi]
    float _adcVoltage;              // voltage of mbed ADC system [V]
    float _fullscale;               // maximum pressure of the sensor [psi]
    float _psi_per_volt_cal;                     // psi per volt calibration [psi/V]
    float _PSI_reading;
};

#endif