Skip to content

Commit

Permalink
Merge pull request #659 from WildernessLabs/develop
Browse files Browse the repository at this point in the history
Merge to main for RC3-1 (step 1)
  • Loading branch information
adrianstevens authored May 6, 2023
2 parents 3790705 + 4fa1da0 commit 6675818
Show file tree
Hide file tree
Showing 727 changed files with 12,376 additions and 6,444 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\..\..\Meadow.Core\Source\implementations\f7\Meadow.F7\Meadow.F7.csproj" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\..\..\Meadow.Core\Source\implementations\f7\Meadow.F7\Meadow.F7.csproj" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\..\..\Meadow.Core\Source\implementations\f7\Meadow.F7\Meadow.F7.csproj" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ public override async Task Run()
Resolver.Log.Info("Turning them on and off for 200ms using SetLed...");
for (int i = 0; i < ledBarGraph.Count; i++)
{
ledBarGraph.SetLed(i, true);
await ledBarGraph.SetLed(i, true);
await Task.Delay(100);
ledBarGraph.SetLed(i, false);
await ledBarGraph.SetLed(i, false);
}

await Task.Delay(1000);
Expand All @@ -59,8 +59,7 @@ public override async Task Run()
while (percentage < 1)
{
percentage += 0.10f;
Resolver.Log.Info($"{percentage}");
ledBarGraph.Percentage = Math.Min(1.0f, percentage);
await ledBarGraph.SetPercentage(Math.Min(1.0f, percentage));
await Task.Delay(100);
}

Expand All @@ -70,8 +69,7 @@ public override async Task Run()
while (percentage > 0)
{
percentage -= 0.10f;
Resolver.Log.Info($"{percentage}");
ledBarGraph.Percentage = Math.Max(0.0f, percentage);
await ledBarGraph.SetPercentage(Math.Max(0.0f, percentage));
await Task.Delay(100);
}

Expand All @@ -81,9 +79,8 @@ public override async Task Run()
while (percentage < 1)
{
percentage += 0.10f;
Resolver.Log.Info($"{percentage}");
ledBarGraph.Percentage = Math.Min(1.0f, percentage);
ledBarGraph.StartBlink(ledBarGraph.GetTopLedForPercentage());
await ledBarGraph.SetPercentage(Math.Min(1.0f, percentage));
await ledBarGraph.StartBlink(ledBarGraph.GetTopLedForPercentage());
await Task.Delay(2000);
}

Expand All @@ -93,25 +90,24 @@ public override async Task Run()
while (percentage > 0)
{
percentage -= 0.10f;
Resolver.Log.Info($"{percentage}");
ledBarGraph.Percentage = Math.Max(0.0f, percentage);
ledBarGraph.StartBlink(ledBarGraph.GetTopLedForPercentage());
await ledBarGraph.SetPercentage(Math.Max(0.0f, percentage));
await ledBarGraph.StartBlink(ledBarGraph.GetTopLedForPercentage());
await Task.Delay(2000);
}

await Task.Delay(1000);

Resolver.Log.Info("Blinking for 5 seconds at 500ms on/off...");
ledBarGraph.StartBlink();
await ledBarGraph.StartBlink();
await Task.Delay(5000);
ledBarGraph.Stop();
await ledBarGraph.StopAnimation();

await Task.Delay(1000);

Resolver.Log.Info("Blinking for 5 seconds at 200ms on/off...");
ledBarGraph.StartBlink(TimeSpan.FromMilliseconds(200), TimeSpan.FromMilliseconds(200));
await ledBarGraph.StartBlink(TimeSpan.FromMilliseconds(200), TimeSpan.FromMilliseconds(200));
await Task.Delay(5000);
ledBarGraph.Stop();
await ledBarGraph.StopAnimation();

await Task.Delay(1000);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\..\..\Meadow.Core\Source\implementations\f7\Meadow.F7\Meadow.F7.csproj" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Meadow;
using Meadow.Devices;
using Meadow.Foundation.Leds;
using Meadow.Peripherals.Leds;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
Expand Down Expand Up @@ -74,17 +73,17 @@ public override async Task Run()
Resolver.Log.Info("Blinking the LEDs for a second each");
foreach (var led in leds)
{
led.StartBlink();
await led.StartBlink();
await Task.Delay(3000);
led.Stop();
await led.StopAnimation();
}

Resolver.Log.Info("Blinking the LEDs for a second each with on (1s) and off (1s)");
foreach (var led in leds)
{
led.StartBlink(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1));
await led.StartBlink(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1));
await Task.Delay(3000);
led.Stop();
await led.StopAnimation();
}

await Task.Delay(3000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\..\..\Meadow.Core\Source\implementations\f7\Meadow.F7\Meadow.F7.csproj" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Meadow.Devices;
using Meadow.Foundation.Leds;
using Meadow.Hardware;
using Meadow.Peripherals.Leds;
using Meadow.Units;
using System;
using System.Threading.Tasks;
Expand Down Expand Up @@ -50,9 +49,9 @@ public override async Task Run()
Resolver.Log.Info("Turning them on and off for 200ms using SetLed...");
for (int i = 0; i < pwmLedBarGraph.Count; i++)
{
pwmLedBarGraph.SetLed(i, true);
await pwmLedBarGraph.SetLed(i, true);
await Task.Delay(100);
pwmLedBarGraph.SetLed(i, false);
await pwmLedBarGraph.SetLed(i, false);
}

await Task.Delay(1000);
Expand All @@ -61,7 +60,7 @@ public override async Task Run()
while (percentage < 1)
{
percentage += 0.01f;
pwmLedBarGraph.Percentage = Math.Min(1.0f, percentage);
await pwmLedBarGraph.SetPercentage(Math.Min(1.0f, percentage));
await Task.Delay(100);
}

Expand All @@ -71,30 +70,34 @@ public override async Task Run()
while (percentage > 0)
{
percentage -= 0.01f;
pwmLedBarGraph.Percentage = Math.Max(0.0f, percentage);
await pwmLedBarGraph.SetPercentage(Math.Max(0.0f, percentage));
await Task.Delay(100);
}

await Task.Delay(1000);

Resolver.Log.Info("Blinking for 5 seconds at 500ms on/off...");
pwmLedBarGraph.StartBlink();
await pwmLedBarGraph.StartBlink();
await Task.Delay(5000);
pwmLedBarGraph.Stop();
await pwmLedBarGraph.StopAnimation();

await Task.Delay(1000);

Resolver.Log.Info("Bar blinking with high and low brightness for 5 seconds...");
pwmLedBarGraph.StartBlink(TimeSpan.FromMilliseconds(200), TimeSpan.FromMilliseconds(200), 0.75f, 0.25f);
await pwmLedBarGraph.StartBlink(TimeSpan.FromMilliseconds(200), TimeSpan.FromMilliseconds(200), 0.75f, 0.25f);
await Task.Delay(5000);
pwmLedBarGraph.Stop();
await pwmLedBarGraph.StopAnimation();

await Task.Delay(1000);

Resolver.Log.Info("Bar pulsing for 5 seconds...");
pwmLedBarGraph.StartPulse();
await pwmLedBarGraph.StartPulse();
await Task.Delay(5000);
pwmLedBarGraph.Stop();
await pwmLedBarGraph.StopAnimation();

await Task.Delay(1000);

await pwmLedBarGraph.SetBrightness(0);

await Task.Delay(1000);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\..\..\Meadow.Core\Source\implementations\f7\Meadow.F7\Meadow.F7.csproj" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,59 +21,59 @@ public override Task Initialize()
redPwmLed = new PwmLed(Device.Pins.OnboardLedRed, TypicalForwardVoltage.ResistorLimited, CircuitTerminationType.High);
greenPwmLed = new PwmLed(Device.Pins.OnboardLedGreen, TypicalForwardVoltage.ResistorLimited, CircuitTerminationType.High);
bluePwmLed = new PwmLed(Device.Pins.OnboardLedBlue, TypicalForwardVoltage.ResistorLimited, CircuitTerminationType.High);

return Task.CompletedTask;
}

public override Task Run()
{
return PulseLeds();
}

public async Task BrightnessTest(int loopCount)
{
for (int i = 0; i < loopCount; i++) {
for (int i = 0; i < loopCount; i++)
{
Resolver.Log.Info("Blue On @ 1.0");
bluePwmLed.Brightness = 1;
bluePwmLed.SetBrightness(1);
await Task.Delay(1000);

Resolver.Log.Info("Blue at 98.5%");
bluePwmLed.Brightness = 0.985f;
bluePwmLed.SetBrightness(0.985f);
await Task.Delay(1000);

Resolver.Log.Info("Blue Off");
bluePwmLed.Brightness = 0;
bluePwmLed.SetBrightness(0);
await Task.Delay(1000);

Resolver.Log.Info("Blue 50%");
bluePwmLed.Brightness = 0.5f;
bluePwmLed.SetBrightness(0.5f);
await Task.Delay(1000);
bluePwmLed.Stop();
await bluePwmLed.StopAnimation();
}
}

public async Task PulseLeds()
{
while (true)
while (true)
{
Resolver.Log.Info("Pulse Red.");
redPwmLed.StartPulse(TimeSpan.FromMilliseconds(500), lowBrightness: 0.05f);
await redPwmLed.StartPulse(TimeSpan.FromMilliseconds(500), lowBrightness: 0.05f);
await Task.Delay(1000);
Resolver.Log.Info("Stop Red.");
redPwmLed.Stop();
await redPwmLed.StopAnimation();

Resolver.Log.Info("Pulse Blue.");
bluePwmLed.StartPulse(TimeSpan.FromMilliseconds(500), lowBrightness: 0.05f);
await bluePwmLed.StartPulse(TimeSpan.FromMilliseconds(500), lowBrightness: 0.05f);
await Task.Delay(2000);
Resolver.Log.Info("Stop Blue.");
bluePwmLed.Stop();
await bluePwmLed.StopAnimation();

Resolver.Log.Info("Pulse Green.");
greenPwmLed.StartPulse(TimeSpan.FromMilliseconds(500), lowBrightness: 0.0f);
await greenPwmLed.StartPulse(TimeSpan.FromMilliseconds(500), lowBrightness: 0.0f);
await Task.Delay(2000);
Resolver.Log.Info("Stop Green.");
greenPwmLed.Stop();

await greenPwmLed.StopAnimation();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\..\..\Meadow.Core\Source\implementations\f7\Meadow.F7\Meadow.F7.csproj" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Meadow;
using Meadow.Devices;
using Meadow.Foundation.Leds;
using Meadow.Peripherals.Leds;
using Meadow.Units;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -62,58 +61,49 @@ public override async Task Run()

await Task.Delay(1000);

Resolver.Log.Info("Blinking the LED for a bit.");
Resolver.Log.Info("Blinking each LED (on 500ms / off 500ms)");
foreach (var pwmLed in pwmLeds)
{
pwmLed.StartBlink();
await pwmLed.StartBlink();
await Task.Delay(3000);
pwmLed.Stop();
await pwmLed.StopAnimation();
}

await Task.Delay(1000);

Resolver.Log.Info("Blinking the LED for a bit.");
Resolver.Log.Info("Blinking each LED (on 1s / off 1s)");
foreach (var pwmLed in pwmLeds)
{
pwmLed.StartBlink(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1));
await pwmLed.StartBlink(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1));
await Task.Delay(3000);
pwmLed.Stop();
await pwmLed.StopAnimation();
}

await Task.Delay(1000);

Resolver.Log.Info("Pulsing the LED for a bit.");
Resolver.Log.Info("Pulsing each LED (600ms pulse duration)");
foreach (var pwmLed in pwmLeds)
{
pwmLed.StartPulse();
await pwmLed.StartPulse();
await Task.Delay(1000);
pwmLed.Stop();
}

await Task.Delay(1000);

Resolver.Log.Info("Pulsing the LED for a bit.");
foreach (var pwmLed in pwmLeds)
{
pwmLed.StartPulse();
await Task.Delay(1000);
pwmLed.Stop();
await pwmLed.StopAnimation();
pwmLed.IsOn = false;
}

await Task.Delay(1000);

Resolver.Log.Info("Set brightness the LED for a bit.");
foreach (var pwmLed in pwmLeds)
{
pwmLed.Brightness = 0.25f;
pwmLed.SetBrightness(0.25f);
await Task.Delay(250);
pwmLed.Brightness = 0.5f;
pwmLed.SetBrightness(0.5f);
await Task.Delay(250);
pwmLed.Brightness = 0.75f;
pwmLed.SetBrightness(0.75f);
await Task.Delay(250);
pwmLed.Brightness = 1.0f;
pwmLed.SetBrightness(1.0f);
await Task.Delay(250);
pwmLed.Stop();
pwmLed.IsOn = false;
}

await Task.Delay(1000);
Expand Down
Loading

0 comments on commit 6675818

Please sign in to comment.