#include "mbed.h"
I2C i2c(28, 27);
Serial pc(USBTX, USBRX);
const int write_addr=0xC4; // write_addr is chip address , include a write operation bit
const int read_addr=0xC5;
char addr[2]= {0x00,0x8B}; //addr[0] is register address and addr[1] is command
int main() {
pc.printf("Program Begin ...\n"); // can execute
i2c.write(write_addr,addr,1); // can not execute !!! Why ?
}
Could you tell me why write operation can not execute ?
and sometime happen errors:
I2C start W returned incorrect status (0x20) in I2C::write
SIGABRT: Abnormal termination
Why ?
#include "mbed.h"
I2C i2c(28, 27);
Serial pc(USBTX, USBRX);
const int write_addr=0xC4; // write_addr is chip address , include a write operation bit
const int read_addr=0xC5;
char addr[2]= {0x00,0x8B}; //addr[0] is register address and addr[1] is command
int main() {
pc.printf("Program Begin ...\n"); // can execute
i2c.write(write_addr,addr,1); // can not execute !!! Why ?
}
Could you tell me why write operation can not execute ?
and sometime happen errors:
I2C start W returned incorrect status (0x20) in I2C::write
SIGABRT: Abnormal termination
Why ?