![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Who_am_I readtest
Dependencies: mbed
main.cpp
- Committer:
- ponpoko1939
- Date:
- 2018-07-12
- Revision:
- 0:213f9a70f694
File content as of revision 0:213f9a70f694:
#include "mbed.h" I2C i2c(p9,p10); Serial pc(USBTX, USBRX); const int addr = 0x68;//KP-9250のスレーブアドレス char cmd[2]; char get[2]; int main() { cmd[0] = 0x75; i2c.write(addr,cmd,1); i2c.read(addr,get,1); pc.printf("%d\n\r",get[0]); }