Fixed apds9960 read call.

This commit is contained in:
klaute 2020-02-18 20:06:03 +01:00
parent d383677b80
commit f9ee9740ae
4 changed files with 7 additions and 7 deletions

4
firmware/firmware.ino Normal file → Executable file
View file

@ -85,7 +85,7 @@ void setup() {
#ifdef SENSOR_APDS9960
if (sensor_apds9960_begin()) {
sensors[SENSOR_LIGHT] = &apds9930_light;
sensors[SENSOR_LIGHT] = &apds9960_light;
}
#endif
@ -232,4 +232,4 @@ void logToSerial(float sensorValues[]) {
Serial.println("Bat Voltage: " + String(sensorValues[SENSOR_BAT_VOLTAGE]) + " V");
Serial.println("Bat charge state: " + String(sensorValues[SENSOR_BATCHARGESTATE]));
Serial.println("Energy saving: " + String(sensorValues[SENSOR_ESAVEMODE]));
}
}

2
firmware/sensor_apds9930.ino Normal file → Executable file
View file

@ -20,4 +20,4 @@ float apds9930_light() {
} else {
return 0;
}
}
}

4
firmware/sensor_battery.ino Normal file → Executable file
View file

@ -1,4 +1,4 @@
float _sensor_battery_saveMode = nan("no battery");
float _sensor_battery_saveMode = ENERGY_SAVE_MODE_DISABLED;
uint16_t energySavingIterations = 0;
// Copied from https://arduinodiy.wordpress.com/2016/12/25/monitoring-lipo-battery-voltage-with-wemos-d1-minibattery-shield-and-thingspeak/
@ -45,4 +45,4 @@ int energySavingMode() {
float isEnergySavingMode() {
return _sensor_battery_saveMode;
}
}

4
firmware/sensor_bme280.ino Normal file → Executable file
View file

@ -6,7 +6,7 @@ Adafruit_BME280 _sensor_bme280;
bool sensor_bme280_begin(uint8_t addr) {
bool status = _sensor_bme280.begin(addr);
if (status) {
debug("BME280 Connected!");
debug("BME280 Connected");
} else {
debug("Could not find a valid BME280 sensor, check wiring!");
}
@ -21,4 +21,4 @@ float bme280_pressure() {
}
float bme280_humidity() {
return _sensor_bme280.readHumidity() * HUMIDITY_FACTOR;
}
}