mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-13 17:22:54 -05:00
Reference level changes
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
Light
|
||||
</td>
|
||||
<td>
|
||||
{{ ((latestReading.LightLevel / latestReading.BatteryLevel) * 100).toFixed(2) }}%
|
||||
{{ ((latestReading.LightLevel / 3.3) * 100).toFixed(2) }}%
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
document.getElementById("temperature-value").textContent = data.humidityTemperature.toFixed(1) + '°F';
|
||||
document.getElementById("humidity-value").textContent = data.humidity.toFixed(1) + '%';
|
||||
document.getElementById("pressure-value").textContent = (data.pressure / 33.864 / 100.0).toFixed(1) + '"';
|
||||
document.getElementById("light-value").textContent = ((data.lightLevel / data.batteryLevel) * 100.0).toFixed(1) + '%';
|
||||
document.getElementById("light-value").textContent = ((data.lightLevel / 3.3) * 100.0).toFixed(1) + '%';
|
||||
|
||||
xmlhttp = null;
|
||||
} else {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user