![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Code for 'Smart Regulator' featured in 'Model Engineer', November 2020 on. Contains all work to August 2020 including all code described. Top level algorithm development is quite spares, leaving some work for you! Any questions - jon@jons-workshop.com
Dependencies: mbed BufferedSerial Servo2 PCT2075 I2CEeprom FastPWM
Diff: baro.h
- Revision:
- 3:43cb067ecd00
diff -r 8e7b51353f32 -r 43cb067ecd00 baro.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/baro.h Mon Jul 27 08:44:59 2020 +0000 @@ -0,0 +1,21 @@ +class MPL3115A2 { // Barometer, pressure sensor, thermometer + static const int ps_wr = 0xc0; // set bit 0 for read, clear bit 0 for write + char mode, + dest[8]; + bool RegWr (int reg, char val) ; + bool RegRd (int reg1, int len, char *array) ; + double Temp, Pres, Alti, Adju, inHg; + public : + bool good; + MPL3115A2 () ; // Constructor + bool Update () ; // Returns true on apparent success + bool busy_check () ; + void reset_zero_inHg () ; + void mode_alti () ; + void mode_pres () ; + double Temperature () ; + double Pressure () ; + double Altitude () ; + double inHg_vacuum () ; +} ; +