2013年2月12日火曜日

地磁気センサ


GPS関係を設計中。GPSの方位だと心もとないので地磁気センサー搭載を相談。
地磁気センサーは入手性と値段考えると、HMC5883Lかねー。

構造体は方位の場所は開けてあった。
まぁLSB=1degでも十分なんだが。LSB 0.1degで取ってあった。
実際どの程度の分解能でるのかは不明。

typedef struct udpdata_t{
    Byte sid[8];                 
    //----------------------------
    unsigned short rpm;         
    unsigned short speed;        
    Byte eg_status;              
    Byte volt;                    
    Byte eg_load; // RESERVED
    Byte timingadvance;          
    //----------------------------
    Byte vacpress; // RESERVED
    Byte vactemp;                
    Byte watertemp;            
    Byte fuel; // RESERVED
    short innertemp;
    short outertemp;
    //-----------------------------
    Byte _r2;  // RESERVED
    Byte _r3;  // RESERVED
    Byte _r4;  // RESERVED
    Byte _r5;  // RESERVED
    Byte sw_c;
    Byte sw_c_lp;
    unsigned short direction;  <<<ココ
    //----------------------------
    Byte lati_dd;                
    Byte lati_mm;                
    unsigned short lati_mmmm;    
    Byte longi_dd;               
    Byte longi_mm;               
    unsigned short longi_mmmm;   
    //----------------------------
    unsigned int pluse;          
    //----------------------------
    unsigned short  Tire_press_FR;  // RESERVED
    unsigned short  Tire_press_FL;  // RESERVED
    unsigned short  Tire_press_RR;  // RESERVED
    unsigned short  Tire_press_RL;  // RESERVED
    Byte Tire_temp_FR;  // RESERVED
    Byte Tire_temp_FL;  // RESERVED
    Byte Tire_temp_RR;  // RESERVED
    Byte Tire_temp_RL;  // RESERVED
    Byte TPMS_Batt_FR;  // RESERVED
    Byte TPMS_Batt_FL;  // RESERVED
    Byte TPMS_Batt_RR;  // RESERVED
    Byte TPMS_Batt_RL;  // RESERVED
    //----------------------------
    Byte flag;                   
    Byte gps;                    
    Byte sw_a;                   
    Byte sw_a_lp;                
    Byte sw_b;                   
    Byte sw_b_lp;                
    Byte sw_ab;                  
    Byte sw_ab_lp;               
    //----------------------------
    unsigned short oilpress;     
    unsigned short oiltemp;      
    
}udpdata;

0 件のコメント:

コメントを投稿