VEML6030, High Accuracy Ambient Light Sensor with I2C Interface

Dependents:   testVEML6030

Revision:
1:00f62b381f9e
Parent:
0:852cb01d2317
--- a/VEML6030.cpp	Thu Mar 30 04:03:59 2017 +0000
+++ b/VEML6030.cpp	Sat Apr 29 07:56:03 2017 +0000
@@ -84,8 +84,8 @@
 {
     uint8_t data[3] ;
     data[0] = CMD_ALS_CONF ;
-    data[1] = (conf >> 8) & 0xFF ;
-    data[2] = conf & 0xFF ;
+    data[1] = conf & 0xFF ;
+    data[2] = (conf >> 8) & 0xFF ;
     writeRegs(data, 3) ;
 }
 
@@ -93,8 +93,8 @@
 {
     uint8_t data[3] ;
     data[0] = CMD_ALS_WH ;
-    data[1] = (wh >> 8) & 0xFF ;
-    data[2] = wh & 0xFF ;
+    data[1] = wh & 0xFF ;
+    data[2] = (wh >> 8) & 0xFF ;
     writeRegs(data, 3) ;
 }
 
@@ -102,8 +102,8 @@
 {
     uint8_t data[3] ;
     data[0] = CMD_ALS_WL ;
-    data[1] = (wl >> 8) & 0xFF ;
-    data[2] = wl & 0xFF ;
+    data[1] = wl & 0xFF ;
+    data[2] = (wl >> 8) & 0xFF ;
     writeRegs(data, 3) ;
 }
 
@@ -111,8 +111,8 @@
 {
     uint8_t data[3] ;
     data[0] = CMD_PWR_SAVINGS ;
-    data[1] = (ps >> 8) & 0xFF ;
-    data[2] = ps & 0xFF ;
+    data[1] = ps & 0xFF ;
+    data[2] = (ps >> 8) & 0xFF ;
     writeRegs(data, 3) ;
 }
 
@@ -122,7 +122,7 @@
     uint8_t cmd = CMD_ALS ;
     uint8_t data[2] ;
     readRegs(cmd, data, 2) ;
-    als = (data[0] << 8) | data[1] ;
+    als = (data[1] << 8) | data[0] ;
     return( als ) ;
 }
 
@@ -132,7 +132,7 @@
     uint8_t cmd = CMD_WHITE ;
     uint8_t data[2] ;
     readRegs(cmd, data, 2) ;
-    white = (data[0] << 8) | data[1] ;
+    white = (data[1] << 8) | data[0] ;
     return( white ) ;
 }
 
@@ -142,7 +142,7 @@
     uint8_t cmd = CMD_ASL_INT ;
     uint8_t data[2] ;
     readRegs(cmd, data, 2) ;
-    als_int = (data[0] << 8) | data[1] ;
+    als_int = (data[1] << 8) | data[0] ;
     return( als_int ) ;
 }