Line 48 commented out
Dependents: UPAS_MicroBLE ENV_NODE_REQUEST_POC ENV_F303K8
Fork of SI1145 by
Diff: SI1145.cpp
- Revision:
- 6:642ece0fad39
- Parent:
- 5:2260652f0296
- Child:
- 7:3e3fe1852990
--- a/SI1145.cpp Sun Jun 14 01:25:38 2015 +0000 +++ b/SI1145.cpp Sun Jun 14 01:33:47 2015 +0000 @@ -186,10 +186,10 @@ return vali; } -uint16_t SI1145::getVIS() +int SI1145::getVIS() { // Variables - float valf; // vis (IR+UV) value + //float valf; // vis (IR+UV) value char reg[1]; // register char data[2] = {0,0}; // data 2 x 8 bits uint16_t vali; // vis value @@ -200,19 +200,18 @@ i2c.read(address, data, 2); // Merge bytes vali = data[0] | (data[1] << 8); // int - valf = (float)vali; - valf = valf/100; // convert to float + //valf = (float)vali; // convert to float // Return value - return valf; + return vali; } -uint16_t SI1145::getIR() +int SI1145::getIR() { // Variables //float valf; // ir value char reg[1]; // register char data[2] = {0,0}; // data 2 x 8 bits - uint16_t vali; // ir value + int vali; // ir value // Set register reg[0] = 0x24; // Read registers @@ -225,13 +224,13 @@ return vali; } -uint16_t SI1145::getPROX() +int SI1145::getPROX() { // Variables //float valf; // prox value char reg[1]; // register char data[2] = {0,0}; // data 2 x 8 bits - uint16_t vali; // prox value + int vali; // prox value // Set register reg[0] = 0x26; // Read registers