|
|
@@ -122,6 +122,17 @@ void read_sensor2(int32_t* temp, uint32_t* pressure, uint32_t* humidity) { |
|
|
|
*humidity = comp_data.humidity; |
|
|
|
} |
|
|
|
|
|
|
|
double read_light_sensor() { |
|
|
|
uint8_t raw_high = 0; |
|
|
|
|
|
|
|
i2c_read(0x4a, 0x03, &raw_high, 1); |
|
|
|
|
|
|
|
uint8_t exp = raw_high >> 4; |
|
|
|
uint8_t mant = raw_high & 0b00001111; |
|
|
|
|
|
|
|
return pow(2, exp) * mant * 0.72; |
|
|
|
} |
|
|
|
|
|
|
|
void init_sensors() |
|
|
|
{ |
|
|
|
// INIT SENSOR |
|
|
|