Temporary Connector Reversed Version

Dependencies:   UniGraphic mbed vt100

afero_poc15_180403R , J1 のピン配置を反転させたヴァージョンです。

Color2系を使用するためには以下のピンをジャンパで接続してください。
J1-D7 <-> J1-D0
J1-D6 <-> J1-D1

(調査中) また、こちらでテストした範囲では、
FRDM-KL25Z の V3.3 を、Modulo2 の VCC_3V3 ピンに接続してやる必要がありました。

尚、J1-D1, D0 を使用するために UART を無効にしているため
ログは表示されません。

TFTモジュールについて 
aitendoのTFTモジュールはデフォルトでは8bit bus モードになっています。
/media/uploads/Rhyme/img_2364.jpg

半田のジャンパを変えて、SPIの設定にしてください。
/media/uploads/Rhyme/img_2363.jpg

サーミスタについて
POC1.5 では サーミスタは 25℃の時に抵抗値が 50.0kΩになる502AT-11 が
4.95kΩのプルアップ(実際は10kΩx2の並列)で使用されていました。

今回の試作では抵抗値が 10.0kΩの 103AT-11 が
5.1kΩのプルアップで使用されていますので、係数を合わせるために
SMTC502AT-11 のコンストラクタを 
R0 = 10.0
R1 = 5.1
B = 3435
T0 = 298.15
で呼ぶように変更しました。

edge_sensor/edge_pressure.h

Committer:
Rhyme
Date:
2018-04-24
Revision:
0:0b6732b53bf4

File content as of revision 0:0b6732b53bf4:

#ifndef _EDGE_PRESSURE_H_
#define _EDGE_PRESSURE_H_
#include "mbed.h"
#include "edge_sensor.h"
#include "PSE530.h"

/**
 * edge_pressure edge_sensor for measuring gas presssure
 */

class edge_pressure : public edge_sensor {
public:
/**
 * constructor 
 * @param *pse PSE530 pressure sensor object
 */
    edge_pressure(PSE530 *pse, DigitalOut *en) ;

/**
 * destructor
 */
    ~edge_pressure(void) ;
    
/**
 * reset and clear internal values
 */
    virtual void    reset(void) ;

/**
 * prepare for sampling (not used)
 */
    virtual void    prepare(void) ;
    
/**
 * sample the value
 * @returns 0: success non-0: failure
 */
    virtual int    sample(void) ;

/**
 * deliver the sampled value to afero cloud
 */
    virtual int     deliver(void) ;
    
/**
 * show the value in the display (TFT)
 */
    virtual void    show(void) ;
//    virtual void    send_config(void) ; /* send config data to cloud */
//    virtual void    recv_config(void) ; /* receive config data from cloud */

/**
 * get_value sample sensor value and calcurate it to the metric value
 * @returns measured value in kgf/cm2
 */
    float get_value(void) ;

/**
 * Set threshold mode
 * @param mode int 0: absolute value 1: relative value in percent
 */
    void  set_thr_mode(int mode)    { _thr_mode = mode ; }

/**
 * Get threshold mode
 * @returns the mode 0: absolute value 1: relative value in percent
 */
    int   get_thr_mode(void)        { return _thr_mode ; }
    
/**
 * Set higher threshold
 * @param thr_high int16_t the higher threshold
 */
    void  set_thr_high(int16_t thr_high) ;
    
/**
 * Get higher threshold, the value is calcurated with expected value
 * @param expected float the expected pressure value for current temperature
 */
    float get_thr_high(float expected) ;
    
/**
 * Set lower threshold
 * @param thr_low int16_t the lower threshold
 */
    void  set_thr_low(int16_t thr_low) ;
    
/**
 * Get lower threshold, the value is calcurated with expected value
 * @param expected float the expected pressure value for current temperature
 */
    float get_thr_low(float expected)  ;
    
/**
 * draw triangle pointer for GAS pressure mode display
 */

    void drawPointer(int c) ;
    
private:
    PSE530  *_pse ;
    DigitalOut *_en ;
    float   _value ;
    float   _thr_high ;
    float   _thr_low ;
    int     _thr_mode ;
    float   _expected ;
    float   _higher ;
    float   _lower ;
} ;

float temp2expected(float temp) ;
extern float *current_temp ;

#endif /* _EDGE_PRESSURE_H_ */