Blame |
Last modification |
View Log
| RSS feed
typedef struct
{
uint8_t STATE;
unsigned int DRDY;
uint8_t AXIS;
signed int x_axis;
signed int y_axis;
signed int z_axis;
signed int x_axis_last_valid;
signed int y_axis_last_valid;
signed int z_axis_last_valid;
signed int NickGrad;
signed int RollGrad;
}MM3_struct;
extern MM3_struct MM3;
void init_spi(void);
void MM3_timer0(void);
signed int MM3_heading(void);
#define Int2Grad_Faktor 1024
// Die Werte der Statemachine
#define MM3_RESET 0
#define MM3_START_TRANSFER 1
#define MM3_WAIT_DRDY 2
#define MM3_DRDY 4
#define MM3_BYTE2 8
#define MM3_X 16
#define MM3_Y 32
#define MM3_Z 64
#define MM3_TILT 128
// Die Werte der Kompasskalibrierung
#define MM3_Xmin -806
#define MM3_Xmax 784
#define MM3_Ymin -865
#define MM3_Ymax 925
#define MM3_Zmin -813
#define MM3_Zmax 849
// Die Werte der Kompasskalibrierung
// OFFSET: (Maximaler Wert + minimaler Wert) / 2
#define OFF_X (MM3_Xmax + MM3_Xmin) /2 //-11
#define OFF_Y (MM3_Ymax + MM3_Ymin) /2 //30
#define OFF_Z (MM3_Zmax + MM3_Zmin) /2 //18