refactor xbee complet
Fork of Repo_Noeud_Mobile by
Embed:
(wiki syntax)
Show/hide line numbers
MMA8452Q.h
00001 #include "mbed.h" 00002 #define SPEED 0.05 00003 #define W_ADDR 0x3A 00004 #define R_ADDR 0x3B 00005 #define WHO_AM_I 0x0D 00006 #define CTRL_REG1 0x2A 00007 #define X_OUT_MSB 0x01 00008 #define TRANSIENT_CFG 0x1D 00009 #define THRESHOLD_REG 0x1F 00010 #define DEBOUNCE_CFG 0x20 00011 #define CTRL_REG4 0x2D 00012 #define CTRL_REG5 0x2E 00013 #define TRANSIENT_VALUE 0x1E 00014 00015 typedef struct { 00016 uint16_t x; 00017 uint16_t y; 00018 uint16_t z; 00019 } accel_t; 00020 00021 class Accel 00022 { 00023 public: 00024 // Public member attrbutes 00025 int nack; 00026 accel_t accel_data; 00027 00028 00029 //public member functions 00030 Accel(); 00031 uint8_t init_MMA8452(); 00032 uint8_t get_WHO_AM_I(); 00033 uint8_t set_CTRL_REG1(); 00034 accel_t get_axis_values(); 00035 uint8_t set_STANDBY_MODE(); 00036 uint8_t set_TRANSIENT_MODE(char axis, char count, char debounce); 00037 uint8_t clear_TRANSIENT_INTERRUPT(); 00038 }; 00039
Generated on Thu Jul 21 2022 13:34:51 by
1.7.2
