si1145 library
Dependents: FRDM_ApplicationShield_GroveSensors
Revision 8:4511725f06b2, committed 2015-06-14
- Comitter:
- caseyquinn
- Date:
- Sun Jun 14 01:40:33 2015 +0000
- Parent:
- 7:3e3fe1852990
- Child:
- 9:daf5ed7c7c3e
- Commit message:
- again and again
Changed in this revision
SI1145.cpp | Show annotated file Show diff for this revision Revisions of this file |
SI1145.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/SI1145.cpp Sun Jun 14 01:36:06 2015 +0000 +++ b/SI1145.cpp Sun Jun 14 01:40:33 2015 +0000 @@ -167,7 +167,7 @@ i2c.write(address, REG_COMMAND, 2); } -float SI1145::getUV() +uint16_t SI1145::getUV() { // Variables //float valf; // uv value @@ -186,13 +186,13 @@ return vali; } -int SI1145::getVIS() +uint16_t SI1145::getVIS() { // Variables //float valf; // vis (IR+UV) value char reg[1]; // register char data[2] = {0,0}; // data 2 x 8 bits - int vali; // vis value + uint16_t vali; // vis value // Set register reg[0] = 0x22; // Read registers @@ -205,13 +205,13 @@ return vali; } -int SI1145::getIR() +uint16_t SI1145::getIR() { // Variables //float valf; // ir value char reg[1]; // register char data[2] = {0,0}; // data 2 x 8 bits - int vali; // ir value + uint16_t vali; // ir value // Set register reg[0] = 0x24; // Read registers @@ -224,13 +224,13 @@ return vali; } -int SI1145::getPROX() +uint16_t SI1145::getPROX() { // Variables //float valf; // prox value char reg[1]; // register char data[2] = {0,0}; // data 2 x 8 bits - int vali; // prox value + uint16_t vali; // prox value // Set register reg[0] = 0x26; // Read registers
--- a/SI1145.h Sun Jun 14 01:36:06 2015 +0000 +++ b/SI1145.h Sun Jun 14 01:40:33 2015 +0000 @@ -41,15 +41,15 @@ /** Begin Initialization SI1145 sensor * Configure sensor setting and read parameters for calibration */ - int getUV(void); + uint16_t getUV(void); /** Read the current VIS value from SI1145 sensor */ - int getVIS(void); + uint16_t getVIS(void); float getUVlsb(void); float getUVmsb(void); /** Read the current IR value from SI1145 sensor */ - int getIR(void); + uint16_t getIR(void); /** Read the current PROX value from SI1145 sensor */ uint16_t getPROX(void);