Skip to content

Commit

Permalink
Updated gauges
Browse files Browse the repository at this point in the history
  • Loading branch information
Lance McCarthy committed Feb 14, 2017
1 parent 698781a commit 9165cac
Show file tree
Hide file tree
Showing 2 changed files with 210 additions and 158 deletions.
13 changes: 6 additions & 7 deletions SmartShade/SmartShade/ViewModels/DashboardViewModel.cs
Expand Up @@ -92,22 +92,21 @@ private async Task Init()

private void OnTick(object sender, object e)
{
LightLevelReading = hat.GetLightLevel();

TemperatureReading = ConvertTemp.ConvertCelsiusToFahrenheit(hat.GetTemperature());

// Status LEDs

if (i++ % 5 == 0) // this is true every 500ms
{
// an LED I'll put some where on the external enclosure
hat.SetPwmDutyCycle(FEZHAT.PwmPin.Pwm6, AreLedsOn ? 1.0 : 0.0);
// If you want an LED some where on the external enclosure, use a PWN PIN
//hat.SetPwmDutyCycle(FEZHAT.PwmPin.Pwm6, AreLedsOn ? 1.0 : 0.0);

// On-board LED
hat.DIO24On = AreLedsOn;

AreLedsOn = !AreLedsOn;
}

LightLevelReading = hat.GetLightLevel() * 100;

TemperatureReading = ConvertTemp.ConvertCelsiusToFahrenheit(hat.GetTemperature());
}

public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary<string, object> state)
Expand Down

0 comments on commit 9165cac

Please sign in to comment.