Library for the BH1750 Digital 16-bit Serial Output Type Ambient Light Sensor IC.

Revision:
1:8115dc8275eb
Parent:
0:bea4477679ee
--- a/BH1750.cpp	Thu Aug 10 12:47:55 2017 +0000
+++ b/BH1750.cpp	Thu Aug 10 16:28:23 2017 +0000
@@ -1,5 +1,5 @@
 /**
- * @brief       BH1750.h
+ * @brief       BH1750.cpp
  * @details     Digital 16-bit Serial Output Type Ambient Light Sensor IC.
  *              Functions file.
  *
@@ -18,11 +18,11 @@
  
 
  
-BH1750::BH1750 ( PinName sda, PinName scl, uint32_t addr, uint32_t hz )
+BH1750::BH1750 ( PinName sda, PinName scl, uint32_t addr, uint32_t freq )
         : i2c         ( sda, scl )
         , BH1750_Addr ( addr )
 {
-    i2c.frequency(hz);
+    i2c.frequency( freq );
 }
  
  
@@ -134,7 +134,7 @@
  * @brief       uint32_t  BH1750_TriggerMeasurement   ( uint32_t )
  * @details     Trigger a new temperature measurement.
  *
- * @param[in]    MODE:          ONE-SHOT or CONTINUOUSLY measurement ( Normal Mode or Mode2 ).
+ * @param[in]    mode:          ONE-SHOT or CONTINUOUSLY measurement ( Normal Mode or Mode2 ).
  *
  * @param[out]   Status of BH1750_TriggerMeasurement.
  *
@@ -148,12 +148,12 @@
  * @warning     The measuring time depends on the chosen resolution ( MODE ). The user
  *              must take this into account.
  */
-uint32_t  BH1750::BH1750_TriggerMeasurement    ( uint32_t MODE )
+uint32_t  BH1750::BH1750_TriggerMeasurement    ( BH1750_COMMANDS mode )
 {
-    char        cmd[]               =   { MODE };
+    char        cmd[]               =   { mode };
     uint32_t    aux                 =    0;
 
-    BH1750_Mode                     =    MODE;
+    BH1750_Mode                     =    mode;
 
 
     aux = i2c.write ( BH1750_Addr, &cmd[0], 1 );