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
baro.h@5:6ca3e7ffc553, 2020-12-05 (annotated)
- Committer:
- JonFreeman
- Date:
- Sat Dec 05 12:40:17 2020 +0000
- Revision:
- 5:6ca3e7ffc553
- Parent:
- 3:43cb067ecd00
Code for 'Smart Regulator' to August 2020, published as is. Basic low-level functions all thoroughly tested and debugged, top level algorithms have scope for further development - over to you! For help contact jon @ jons-workshop[.com
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JonFreeman | 3:43cb067ecd00 | 1 | class MPL3115A2 { // Barometer, pressure sensor, thermometer |
JonFreeman | 3:43cb067ecd00 | 2 | static const int ps_wr = 0xc0; // set bit 0 for read, clear bit 0 for write |
JonFreeman | 3:43cb067ecd00 | 3 | char mode, |
JonFreeman | 3:43cb067ecd00 | 4 | dest[8]; |
JonFreeman | 3:43cb067ecd00 | 5 | bool RegWr (int reg, char val) ; |
JonFreeman | 3:43cb067ecd00 | 6 | bool RegRd (int reg1, int len, char *array) ; |
JonFreeman | 3:43cb067ecd00 | 7 | double Temp, Pres, Alti, Adju, inHg; |
JonFreeman | 3:43cb067ecd00 | 8 | public : |
JonFreeman | 3:43cb067ecd00 | 9 | bool good; |
JonFreeman | 3:43cb067ecd00 | 10 | MPL3115A2 () ; // Constructor |
JonFreeman | 3:43cb067ecd00 | 11 | bool Update () ; // Returns true on apparent success |
JonFreeman | 3:43cb067ecd00 | 12 | bool busy_check () ; |
JonFreeman | 3:43cb067ecd00 | 13 | void reset_zero_inHg () ; |
JonFreeman | 3:43cb067ecd00 | 14 | void mode_alti () ; |
JonFreeman | 3:43cb067ecd00 | 15 | void mode_pres () ; |
JonFreeman | 3:43cb067ecd00 | 16 | double Temperature () ; |
JonFreeman | 3:43cb067ecd00 | 17 | double Pressure () ; |
JonFreeman | 3:43cb067ecd00 | 18 | double Altitude () ; |
JonFreeman | 3:43cb067ecd00 | 19 | double inHg_vacuum () ; |
JonFreeman | 3:43cb067ecd00 | 20 | } ; |
JonFreeman | 3:43cb067ecd00 | 21 |