ADS1015 library

Dependents:   s-rov-firmware

Revision:
2:2407708483f4
Parent:
0:b3c2afab9578
--- a/ads1015.cpp	Thu Jan 26 17:31:08 2017 +0000
+++ b/ads1015.cpp	Thu Jan 26 18:02:32 2017 +0000
@@ -13,7 +13,7 @@
     uint16_t config = ADS1015_CONFIG_COMP_QUE_NONE    | // disable comparator
                       ADS1015_CONFIG_COMP_LAT_NONE    | // nonlatching comparator
                       ADS1015_CONFIG_COMP_POL_ACTVLOW | // Alert/Rdy active low
-                      CONFIG_COMP_MODE_TRAD           | // Traditional comparator
+                      ADS1015_CONFIG_COMP_MODE_TRAD           | // Traditional comparator
                       ADS1015_CONFIG_DR_1600SPS       | // Data rate : 1600sps
                       ADS1015_CONFIG_MODE_SINGLE      | // Single shot mode
                       m_gain;                           // Set gain
@@ -54,5 +54,5 @@
     cmd[0] = reg;
     i2c->write(ADS1015_ADDR, cmd, 1);
     i2c->read(ADS1015_ADDR, cmd, 2);
-    return (data[0] << 8 | data[1]);    
+    return (cmd[0] << 8 | cmd[1]);    
 }
\ No newline at end of file