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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers baro.h Source File

baro.h

00001 class   MPL3115A2   {   //  Barometer, pressure sensor, thermometer
00002     static const int ps_wr = 0xc0;  //  set bit 0 for read, clear bit 0 for write
00003     char    mode,
00004             dest[8];
00005     bool    RegWr  (int reg, char val)    ;
00006     bool    RegRd  (int reg1, int len, char *array)   ;
00007     double  Temp, Pres, Alti, Adju, inHg;
00008     public :
00009     bool    good;
00010     MPL3115A2   ()  ;   //  Constructor
00011     bool    Update      ()  ;   //  Returns true on apparent success
00012     bool    busy_check  ()  ;
00013     void    reset_zero_inHg  ()  ;
00014     void    mode_alti   ()  ;
00015     void    mode_pres   ()  ;
00016     double  Temperature ()  ;
00017     double  Pressure    ()  ;
00018     double  Altitude    ()  ;
00019     double  inHg_vacuum ()  ;
00020 }   ;
00021