Skip to content

Commit

Permalink
Merge pull request WildernessLabs#36 from WildernessLabs/v1.2.0
Browse files Browse the repository at this point in the history
V1.2.0
  • Loading branch information
jorgedevs authored Aug 2, 2023
2 parents a5783c5 + c09483d commit 85cb60d
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions Source/Clima_Demo/MeadowApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,51 +15,44 @@ public class MeadowApp : App<F7CoreComputeV2>

public override Task Initialize()
{
Resolver.Log.Loglevel = Meadow.Logging.LogLevel.Trace;
Resolver.Log.LogLevel = Meadow.Logging.LogLevel.Trace;

Resolver.Log.Info("Initialize hardware...");

clima = Clima.Create();

Resolver.Log.Info($"Running on Clima Hardware {clima.RevisionString}");

//---- BME688 Atmospheric sensor
if (clima.AtmosphericSensor is { } bme688)
{
bme688.Updated += Bme688Updated;
}

//---- SCD40 Environmental sensor
if (clima.EnvironmentalSensor is { } scd40)
{
scd40.Updated += Scd40Updated;
}

//---- Wind Vane sensor
if (clima.WindVane is { } windVane)
{
windVane.Updated += WindvaneUpdated;
}

//---- Rain Gauge sensor
if (clima.RainGauge is { } rainGuage)
{
rainGuage.Updated += RainGuageUpdated;
}

//---- Anemometer
if (clima.Anemometer is { } anemometer)
{
anemometer.WindSpeedUpdated += AnemometerUpdated;
}

//---- Solar Voltage Input sensor
if (clima.SolarVoltageInput is { } solarVoltage)
{
solarVoltage.Updated += SolarVoltageUpdated;
}

//---- GNSS
if (clima.Gnss is { } gnss)
{
//gnss.GsaReceived += GnssGsaReceived;
Expand All @@ -69,10 +62,8 @@ public override Task Initialize()
gnss.GllReceived += GnssGllReceived;
}

//---- heartbeat
Resolver.Log.Info("Initialization complete");

//---- set LED green
clima.ColorLed.SetColor(Color.Green);

return base.Initialize();
Expand Down Expand Up @@ -121,43 +112,36 @@ public override Task Run()

var updateInterval = TimeSpan.FromSeconds(5);

//---- BME688 Atmospheric sensor
if (clima.AtmosphericSensor is { } bme688)
{
bme688.StartUpdating(updateInterval);
}

//---- SCD40 Environmental sensor
if (clima.EnvironmentalSensor is { } scd40)
{
scd40.StartUpdating(updateInterval);
}

//---- Wind Vane sensor
if (clima.WindVane is { } windVane)
{
windVane.StartUpdating(updateInterval);
}

//---- Rain Gauge sensor
if (clima.RainGauge is { } rainGuage)
{
rainGuage.StartUpdating(updateInterval);
}

//---- Anemometer
if (clima.Anemometer is { } anemometer)
{
anemometer.StartUpdating(updateInterval);
}

//---- Solar Voltage Input sensor
if (clima.SolarVoltageInput is { } solarVoltage)
{
solarVoltage.StartUpdating(updateInterval);
}

//---- Neo8 GNSS
if (clima.Gnss is { } gnss)
{
gnss.StartUpdating();
Expand Down

0 comments on commit 85cb60d

Please sign in to comment.