Reference level changes

This commit is contained in:
2020-07-06 12:14:45 -04:00
parent cd2bdf63c6
commit 61e3d065aa
5 changed files with 6 additions and 6 deletions

View File

@@ -193,7 +193,7 @@ void calcWeather()
//This allows us to ignore what VCC might be (an Arduino plugged into USB has VCC of 4.5 to 5.2V)
float get_light_level()
{
float operatingVoltage = analogRead(REFERENCE_3V3);
float operatingVoltage = 1023.0; // analogRead(REFERENCE_3V3);
float lightSensor = analogRead(LIGHT);
@@ -210,7 +210,7 @@ float get_light_level()
//3.9K on the high side (R1), and 1K on the low side (R2)
float get_battery_level()
{
float operatingVoltage = analogRead(REFERENCE_3V3);
float operatingVoltage = 1023.0; // analogRead(REFERENCE_3V3);
float rawVoltage = analogRead(BATT);

View File

@@ -129,7 +129,7 @@ namespace ChrisKaczor.HomeMonitor.Weather.Service.Data
switch (weatherValueType)
{
case WeatherValueType.LightLevel:
query = query.Replace("@Value", "LightLevel / BatteryLevel");
query = query.Replace("@Value", "LightLevel / 3.3");
break;
default:
query = query.Replace("@Value", weatherValueType.ToString());

View File

@@ -13,7 +13,7 @@ FROM (
Humidity,
PressureTemperature,
Pressure,
LightLevel / BatteryLevel AS LightLevel,
LightLevel / 3.3 AS LightLevel,
Rain
FROM Reading
WHERE Timestamp BETWEEN @Start AND @End