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
omegaPX209/omegaPX209.hpp@10:085ab7328054, 2017-10-23 (annotated)
- Committer:
- danstrider
- Date:
- Mon Oct 23 12:50:53 2017 +0000
- Revision:
- 10:085ab7328054
- Parent:
- 9:d5fcdcb3c89d
- Child:
- 14:85b64a4d08e8
checked out on the hardware
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| mkelly10 | 9:d5fcdcb3c89d | 1 | /* |
| mkelly10 | 9:d5fcdcb3c89d | 2 | Matthew Kelly |
| mkelly10 | 9:d5fcdcb3c89d | 3 | October 24th, 2013 |
| mkelly10 | 9:d5fcdcb3c89d | 4 | The purpose of this class is to define a a data structure with all of the necessary information and member functions... |
| mkelly10 | 9:d5fcdcb3c89d | 5 | to fully describe a single ultrasonic transducer for use in a relative positioning system. |
| mkelly10 | 9:d5fcdcb3c89d | 6 | */ |
| mkelly10 | 9:d5fcdcb3c89d | 7 | |
| mkelly10 | 9:d5fcdcb3c89d | 8 | #include "mbed.h" |
| mkelly10 | 9:d5fcdcb3c89d | 9 | |
| danstrider | 10:085ab7328054 | 10 | #define density_of_water_g_cc 1.00 // g/cm^3 (or 1.03 g/cm^3) |
| danstrider | 10:085ab7328054 | 11 | |
| mkelly10 | 9:d5fcdcb3c89d | 12 | class omegaPX209 { |
| mkelly10 | 9:d5fcdcb3c89d | 13 | public: |
| danstrider | 10:085ab7328054 | 14 | omegaPX209(PinName pin); |
| mkelly10 | 9:d5fcdcb3c89d | 15 | void initialize(); |
| danstrider | 10:085ab7328054 | 16 | |
| danstrider | 10:085ab7328054 | 17 | float getPsi(); // returns pressure [psi] |
| danstrider | 10:085ab7328054 | 18 | float getDepth(); // returns water depth [ft] |
| mkelly10 | 9:d5fcdcb3c89d | 19 | |
| mkelly10 | 9:d5fcdcb3c89d | 20 | private: |
| mkelly10 | 9:d5fcdcb3c89d | 21 | AnalogIn depthP; |
| danstrider | 10:085ab7328054 | 22 | Ticker pulse; |
| danstrider | 10:085ab7328054 | 23 | |
| mkelly10 | 9:d5fcdcb3c89d | 24 | float P; // Pressure [psi] |
| mkelly10 | 9:d5fcdcb3c89d | 25 | float cal; // Volts per psi |
| danstrider | 10:085ab7328054 | 26 | float multiplier; // Maximum voltage in (of ADC system) |
| mkelly10 | 9:d5fcdcb3c89d | 27 | }; |