I2C sensor test program, derived from testI2C program. Simple test for FXOS8700CQ, HIH6130, MAG3110, MMA8451Q, MMA8452Q, MPL3115A2, MAX44000, MAX44005, MAX44008, MAX30101 included beside simple I2C read/write from testI2C.
Dependencies: FXOS8700CQ HIH6130 IS31SE5000 MAG3110 MAX44000 MAX44005 MAX44008 MMA8451Q MMA8452Q MPL3115A2 VEML6040 VEML6075 mbed vt100 LM75B FXAS21002 MAX30101 VCNL4020 VCNL4100
Diff: testSensor.cpp
- Revision:
- 18:ee6f43cbfcc1
- Parent:
- 17:514f67d94d12
--- a/testSensor.cpp Wed Sep 13 05:23:18 2017 +0000 +++ b/testSensor.cpp Wed Dec 27 08:31:24 2017 +0000 @@ -179,6 +179,12 @@ i2c = new DUMB_I2C(PIN_SDA, PIN_SCL, address) ; num_data = 2 ; result = i2c->read(0, data, num_data) ; +/* + data[0] = address << 1 ; + i2c->start() ; + result = i2c->write(0, data, 1) ; + i2c->stop() ; +*/ if (result == 0) { printf("%02X : ", address) ; print_sensor_name(address) ;