Release candidate version. The pointer in GAS Pressure display is changed to a triangle.

Dependencies:   UniGraphic mbed vt100

Please note, at 2-Mar-2018 the current version of mbed-lib has a defect in Ticker.
https://os.mbed.com/forum/bugs-suggestions/topic/29287/

So, mbed lib version 157 is intentionally being used.
Please do not update mbed library until the problem in the above URL is fixed.

In this version, format of GAS Pressure Display has been changed.
/media/uploads/Rhyme/low.jpg

/media/uploads/Rhyme/good.jpg

/media/uploads/Rhyme/high.jpg

moto

Committer:
Rhyme
Date:
Fri Mar 02 07:56:09 2018 +0000
Revision:
0:774324cbc5a6
Release candidate version. GAS Pressure pointer is now a triangle.; Some source file clean-up was done.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Rhyme 0:774324cbc5a6 1 #ifndef _EDGE_ACCEL_H_
Rhyme 0:774324cbc5a6 2 #define _EDGE_ACCEL_H_
Rhyme 0:774324cbc5a6 3 #include "mbed.h"
Rhyme 0:774324cbc5a6 4 #include "edge_sensor.h"
Rhyme 0:774324cbc5a6 5 #include "MMA8451Q.h"
Rhyme 0:774324cbc5a6 6
Rhyme 0:774324cbc5a6 7 /**
Rhyme 0:774324cbc5a6 8 * edge_accel edge_sensor which manage the accelerometer sensor (MMA8451Q)
Rhyme 0:774324cbc5a6 9 * @note The behavior of this class is somewhat exceptional as an edge_sensor
Rhyme 0:774324cbc5a6 10 * @note it samples and accumulates data which is the abs sum of current
Rhyme 0:774324cbc5a6 11 * @note values and previous values every 0.1 sec
Rhyme 0:774324cbc5a6 12 * @note and in each "interval" it delivers the averaged value
Rhyme 0:774324cbc5a6 13 */
Rhyme 0:774324cbc5a6 14
Rhyme 0:774324cbc5a6 15 class edge_accel : public edge_sensor {
Rhyme 0:774324cbc5a6 16 public:
Rhyme 0:774324cbc5a6 17 /**
Rhyme 0:774324cbc5a6 18 * constructor
Rhyme 0:774324cbc5a6 19 * @param the MMA8451Q object
Rhyme 0:774324cbc5a6 20 */
Rhyme 0:774324cbc5a6 21 edge_accel(MMA8451Q *accel) ;
Rhyme 0:774324cbc5a6 22
Rhyme 0:774324cbc5a6 23 /**
Rhyme 0:774324cbc5a6 24 * destructor
Rhyme 0:774324cbc5a6 25 */
Rhyme 0:774324cbc5a6 26 ~edge_accel(void) ;
Rhyme 0:774324cbc5a6 27
Rhyme 0:774324cbc5a6 28 /**
Rhyme 0:774324cbc5a6 29 * clear and reset interval values
Rhyme 0:774324cbc5a6 30 */
Rhyme 0:774324cbc5a6 31 virtual void reset(void) ;
Rhyme 0:774324cbc5a6 32 // virtual void prepare(void) ;
Rhyme 0:774324cbc5a6 33
Rhyme 0:774324cbc5a6 34 /**
Rhyme 0:774324cbc5a6 35 * sample calculate the average value
Rhyme 0:774324cbc5a6 36 * from _accumulation and _sample_count
Rhyme 0:774324cbc5a6 37 * the average value is assigned to _value
Rhyme 0:774324cbc5a6 38 * and currnt _sample_count is stored in _num_sampled
Rhyme 0:774324cbc5a6 39 * then both _accumuation and _sample_count will be cleared
Rhyme 0:774324cbc5a6 40 * @returns 0: success non-0: failure
Rhyme 0:774324cbc5a6 41 */
Rhyme 0:774324cbc5a6 42 virtual int sample(void) ;
Rhyme 0:774324cbc5a6 43
Rhyme 0:774324cbc5a6 44 /**
Rhyme 0:774324cbc5a6 45 * deliver the value to the afero cloud
Rhyme 0:774324cbc5a6 46 */
Rhyme 0:774324cbc5a6 47 virtual int deliver(void) ;
Rhyme 0:774324cbc5a6 48
Rhyme 0:774324cbc5a6 49 /**
Rhyme 0:774324cbc5a6 50 * show the data in the display (TFT)
Rhyme 0:774324cbc5a6 51 */
Rhyme 0:774324cbc5a6 52 virtual void show(void) ;
Rhyme 0:774324cbc5a6 53
Rhyme 0:774324cbc5a6 54 /**
Rhyme 0:774324cbc5a6 55 * accum this is the real sampling
Rhyme 0:774324cbc5a6 56 * and the differences of sampled values
Rhyme 0:774324cbc5a6 57 * and previous values are calcurated and accumulated
Rhyme 0:774324cbc5a6 58 * @returns 0: success non-0: failure
Rhyme 0:774324cbc5a6 59 */
Rhyme 0:774324cbc5a6 60 int accum(void) ;
Rhyme 0:774324cbc5a6 61
Rhyme 0:774324cbc5a6 62 /**
Rhyme 0:774324cbc5a6 63 * Clear internal values
Rhyme 0:774324cbc5a6 64 */
Rhyme 0:774324cbc5a6 65 void clear_value(void) ;
Rhyme 0:774324cbc5a6 66
Rhyme 0:774324cbc5a6 67 private:
Rhyme 0:774324cbc5a6 68 MMA8451Q *_accel ;
Rhyme 0:774324cbc5a6 69 float _value ;
Rhyme 0:774324cbc5a6 70 int32_t _num_sampled ;
Rhyme 0:774324cbc5a6 71 int32_t _sample_count ;
Rhyme 0:774324cbc5a6 72 int32_t _accumulation ;
Rhyme 0:774324cbc5a6 73 int16_t _prev_x ;
Rhyme 0:774324cbc5a6 74 int16_t _prev_y ;
Rhyme 0:774324cbc5a6 75 int16_t _prev_z ;
Rhyme 0:774324cbc5a6 76 } ;
Rhyme 0:774324cbc5a6 77
Rhyme 0:774324cbc5a6 78 #endif /* _EDGE_ACCEL_H_ */