Modified for compatibility with Rev.E. hardware
Fork of AkmSensor by
Diff: akmsensormanager.cpp
- Revision:
- 4:af13b985c689
- Parent:
- 2:11fe67783c4c
- Child:
- 6:c4401549d68f
--- a/akmsensormanager.cpp Thu May 05 21:11:23 2016 +0000 +++ b/akmsensormanager.cpp Mon May 09 16:59:33 2016 +0000 @@ -30,8 +30,8 @@ "Current Sensor", "MISC(Analog)", "Linear Sensor", + "TBD3", "IR Sensor", - "TBD3", "Angle Sensor(SPI)", // Temporary "AKD Daughter Cards(I2C)", }; @@ -99,6 +99,7 @@ break; case AkmSensor::AKM_PRIMARY_ID_LINEAR_SENSOR_LEGACY: + case AkmSensor::AKM_PRIMARY_ID_LINEAR_SENSOR: subId = AkmSensorManager::getId(ANALOG_SENSOR_ID_SUB,4); // 4bit sub id AkmLinearSensor* linearsensor; linearsensor = new AkmLinearSensor(); @@ -171,7 +172,7 @@ uint8_t value = (uint8_t)(s*pow(2.0,bits)); #else /* Rev.D */ - MSG("GetID\n"); + MSG("#GetID\n"); I2C i2c(I2C_SDA0, I2C_SCL0); // ADC MCP342X mcp342x(&i2c, MCP342X::SLAVE_ADDRESS_6EH); @@ -189,7 +190,7 @@ const int16_t VAL_MIN = -2048; // Corresponds to 0V uint8_t value = (uint8_t)((val - VAL_MIN)/(float)(VAL_MAX - VAL_MIN) * (1 << bits)); - MSG("ID = %d.", value); + MSG("#ID = %d.\n", value); #endif return value; }