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.
Dependencies: mbed MODSERIAL FATFileSystem
Diff: omegaPX209/omegaPX209.hpp
- Revision:
- 10:085ab7328054
- Parent:
- 9:d5fcdcb3c89d
- Child:
- 14:85b64a4d08e8
--- a/omegaPX209/omegaPX209.hpp Fri Oct 20 11:41:22 2017 +0000
+++ b/omegaPX209/omegaPX209.hpp Mon Oct 23 12:50:53 2017 +0000
@@ -7,16 +7,21 @@
#include "mbed.h"
+#define density_of_water_g_cc 1.00 // g/cm^3 (or 1.03 g/cm^3)
+
class omegaPX209 {
public:
- omegaPX209();
+ omegaPX209(PinName pin);
void initialize();
- float calcP(); // Calculates pressure
+
+ float getPsi(); // returns pressure [psi]
+ float getDepth(); // returns water depth [ft]
private:
AnalogIn depthP;
+ Ticker pulse;
+
float P; // Pressure [psi]
float cal; // Volts per psi
- float multiplier; // Maximum voltage in
-
+ float multiplier; // Maximum voltage in (of ADC system)
};