Driver for the AKM AK9752 IR sensor device.
Library for the AK9752 Ultra-Small IR Sensor with I2C Interface. Includes integrated temperature sensor (0 - 50C) and 16-bit ADC.
Diff: AK9752.cpp
- Revision:
- 9:45495ac12b89
- Parent:
- 6:254b7e5820e7
- Child:
- 10:1cb542a62421
--- a/AK9752.cpp Wed Nov 02 18:28:22 2016 +0000 +++ b/AK9752.cpp Fri Nov 04 18:25:20 2016 +0000 @@ -47,8 +47,6 @@ } else { MSG("ID check failed.\r\n"); - MSG("WIA1: %d\r\n", buf[0]); - MSG("WIA2: %d\r\n", buf[1]); return AK9752::ERROR; } } @@ -223,12 +221,17 @@ // Read 7 bytes starting at ST1: reads ST1, INTCAUSE, data and ST2 at once if ((read(AK9752_REG_ADDR_ST1, buf, LEN_BUF_IR_DATA)) != SUCCESS) { + MSG("AK9752: Failed to read registers.\r\n."); return ERROR; // Read operation failed } // Check Data ReaDY if( (buf[0] & ST1_STATUS_FLAG_DRDY) == 0 ){ // DRDY=0, data not ready + MSG("AK9752: Data not ready (DRDY != 0). Continuing anyway.\r\n"); + +/* NOTE: Bypassing error-checking return ERROR; +*/ } // Read IR threshold, temp threshold and data ready flags