trongtanuet2010
02-04-2013, 12:30 PM
e giao tiếp i2c vdvddddd với pic
ntthaoit
02-04-2013, 04:37 PM
byte read(int device, byte address) {
int value;
i2c_start();
i2c_write(device<<1);
i2c_write(address);
i2c_start();
i2c_write(device<<1|0x01);
value=i2c_read(0);
i2c_stop();
return value;
}
Ax=(read(DEVICE1,AccXH)*256) | (read(DEVICE1,AccXL));
AAy= (double)((double)atan2(Ay,-Ax)*180/pi);
e giao tiếp i2c với pic
mình cũng đang gặp vấn đề giống như thế này, ai biết chỉ dùm mình được không ? đang cần gấp lắm ạ
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.