Hi,
According to the I2C function class document,
read
address 8bit I2C slave address [ addr | 1 ]
so it should be ((0x1D << 1) | 0x01 ) = 0x3B
write
address 8bit I2C slave address [ addr | 0 ]
so it should be ((0x1D << 1) | 0x00) = 0x3A
So why don't you try
i2c2.write(0x3A, &cmd, 1 ) ;
i2c2.read(0x3B, &v, 1 ) ;
In case it does not work, I'm sorry.
moto
Hello, I was working on my FRDM KL25 with KDS. I want to try MBED online compiler. For that I have made a small program wich read a MMA8451 accelerometer (adress 0x1D) connected on PTE0 and PTE1. For your information, it's working fine with my KDS program. The program is very simple:
I should received 0x1A and I received 0x4D Here follow the DataAnalyzer picture:
Thanks for your Help Michel