I'm working with MMA9555L module through an i2c interface, but I'm having a problem with pedometer function in MMA9555L. For a sanity check, I read back the version information which is ok and gets back the desired data but when I want to read the data from pedometer application, the slave returns 0x9C instead of 0x80 which shows the error "the command interpreter does not recognize a command code". How can I fix this error? Here is my code:
Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
void main(){void pedometerConfigRegs();//sets the configuration registers of the pedometer application//send these bytes to the part: 0x15, 0x20, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0xB6, 0x44, 0x04, 0x83, 0x05, 0x82, 0x00, 0x00, 0x00void pedometerReadValue();//reads back from the slave//send these bytes to the part: 0x15, 0x30, 0x00, 0x0Cwhile(1){
read_i2c(16);}}