Skip to content

Commit

Permalink
Nugetize, comments, API updates
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianstevens committed Nov 3, 2022
1 parent 41ae284 commit 38102a7
Show file tree
Hide file tree
Showing 64 changed files with 107 additions and 109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
</PropertyGroup>
<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Peripherals\Sensors.Motion.Adxl3xx\Driver\Sensors.Motion.Adxl3xx.csproj" />
<PackageReference Include="Meadow.Foundation.Sensors.Motion.Adxl3xx" Version="0.*" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Meadow.Sdk/1.1.0">
<Project Sdk="Meadow.Sdk/1.1.0">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
Expand All @@ -9,6 +9,6 @@
<PackageReference Include="Meadow.F7" Version="0.*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Driver\3-AxisDigitalAccelerometer16g.csproj" />
<PackageReference Include="Meadow.Foundation.Grove.Sensors.Motion.3-AxisDigitalAccelerometer_16g" Version="0.*" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
</PropertyGroup>
<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Peripherals\Sensors.Motion.Mma7660fc\Driver\Sensors.Motion.Mma7660fc.csproj" />
<PackageReference Include="Meadow.Foundation.Sensors.Motion.Mma7660fc" Version="0.*" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\Driver\3-AxisDigitalAccelerometer1_5g.csproj" />
<PackageReference Include="Meadow.Foundation.Grove.Sensors.Motion.3-AxisDigitalAccelerometer1_5g" Version="0.*" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
</PropertyGroup>
<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Peripherals\Sensors.Motion.Hmc5883\Driver\Sensors.Motion.Hmc5883.csproj" />
<PackageReference Include="Meadow.Foundation.Sensors.Motion.Hmc5883" Version="0.*" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\Driver\3-AxisDigitalCompass.csproj" />
<PackageReference Include="Meadow.Foundation.Grove.Sensors.Motion.3-AxisDigitalCompass" Version="0.*" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions Source/4-DigitDisplay/Driver/4-DigitDisplay.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
</PropertyGroup>
<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Peripherals\Displays.Tm1637\Driver\Displays.Tm1637.csproj" />
<PackageReference Include="Meadow.Foundation.Displays.Tm1637" Version="0.*" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\Driver\4DigitDisplay.csproj" />
<ProjectReference Include="..\..\Driver\4-DigitDisplay.csproj" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions Source/Button/Driver/Button.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
</PropertyGroup>
<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion Source/Button/Sample/Button_Sample/Button_Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\Driver\Button.csproj" />
<PackageReference Include="Meadow.Foundation.Grove.Sensors.Buttons.Button" Version="0.*" />
</ItemGroup>
</Project>
14 changes: 5 additions & 9 deletions Source/Buzzer/Driver/Buzzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,20 @@ public class Buzzer : PiezoSpeaker
/// <summary>
/// Creates a new Buzzer driver
/// </summary>
/// <param name="port"></param>
/// <param name="port">The PwmPort used to drive the Buzzer</param>
public Buzzer(IPwmPort port)
: base(port)
{ }

/// <summary>
/// Creates a new Buzzer driver
/// </summary>
/// <param name="device"></param>
/// <param name="pin"></param>
/// <param name="frequency"></param>
/// <param name="dutyCycle"></param>
/// <param name="device">The Pwm controller connected to the buzzer (typically Meadow)</param>
/// <param name="pin">The pin connected to the buzzer/param>
public Buzzer(
IPwmOutputController device,
IPin pin,
Frequency frequency,
float dutyCycle = 0)
: base(device, pin, frequency, dutyCycle)
IPin pin)
: base(device, pin, new Frequency(440))
{ }
}
}
2 changes: 1 addition & 1 deletion Source/Buzzer/Driver/Buzzer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
</PropertyGroup>
<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Source/Buzzer/Sample/Buzzer_Sample/Buzzer_Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\Driver\Buzzer.csproj" />
<PackageReference Include="Meadow.Foundation.Grove.Audio.Buzzer" Version="0.*" />
</ItemGroup>
</Project>
9 changes: 5 additions & 4 deletions Source/Buzzer/Sample/Buzzer_Sample/MeadowApp.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Meadow;
using Meadow.Devices;
using Meadow.Foundation.Grove.Audio;
using Meadow.Units;
using System;
using System.Threading.Tasks;

Expand All @@ -17,7 +18,7 @@ public override Task Initialize()
{
Console.WriteLine("Initialize...");

buzzer = new Buzzer(Device, Device.Pins.D13);
buzzer = new Buzzer(Device, Device.Pins.D13, new Frequency(440));

return Task.CompletedTask;
}
Expand All @@ -27,9 +28,9 @@ public override async Task Run()
for (int i = 0; i < 5; i++)
{
Console.WriteLine("Playing A major triad starting at A4");
await buzzer.PlayTone(440, 500); //A
await buzzer.PlayTone(554.37f, 500); //C#
await buzzer.PlayTone(659.25f, 500); //E
await buzzer.PlayTone(new Frequency(440, Frequency.UnitType.Hertz), TimeSpan.FromMilliseconds(500)); //A
await buzzer.PlayTone(new Frequency(554.37f, Frequency.UnitType.Hertz), TimeSpan.FromMilliseconds(500)); //C#
await buzzer.PlayTone(new Frequency(659.25f, Frequency.UnitType.Hertz), TimeSpan.FromMilliseconds(500)); //E

await Task.Delay(2500);
}
Expand Down
2 changes: 1 addition & 1 deletion Source/FlameSensor/Driver/FlameSensor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
</PropertyGroup>
<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\Driver\FlameSensor.csproj" />
<PackageReference Include="Meadow.Foundation.Grove.Sensors.Environmental.FlameSensor" Version="0.*" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Source/LCD/Samples/LCD_Sample/LCD_Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\Driver\LCD.csproj" />
<PackageReference Include="Meadow.Foundation.Grove.Displays.LCD" Version="0.*" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Source/LEDButton/Driver/LEDButton.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
</PropertyGroup>
<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\Driver\LEDButton.csproj" />
<PackageReference Include="Meadow.Foundation.Grove.Sensors.Buttons.LEDButton" Version="0.*" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Source/LEDSocket/Driver/LEDSocket.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
</PropertyGroup>
<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\Driver\LEDSocket.csproj" />
<PackageReference Include="Meadow.Foundation.Grove.Leds.LEDSocket" Version="0.*" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Source/LightSensor/Driver/LightSensor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
</PropertyGroup>
<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\Driver\LightSensor.csproj" />
<PackageReference Include="Meadow.Foundation.Grove.Sensors.Light.LightSensor" Version="0.*" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Source/LineFinder/Driver/LineFinder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
</PropertyGroup>
<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\Driver\LineFinder.csproj" />
<PackageReference Include="Meadow.Foundation.Grove.Sensors.Light.LineFinder" Version="0.*" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Source/LoudnessSensor/Driver/LoudnessSensor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
</PropertyGroup>
<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\Driver\LoudnessSensor.csproj" />
<PackageReference Include="Meadow.Foundation.Grove.Sensors.Sound.LoudnessSensor" Version="0.*" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Source/MagneticSwitch/Driver/MagneticSwitch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
</PropertyGroup>
<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\Driver\MagneticSwitch.csproj" />
<PackageReference Include="Meadow.Foundation.Grove.Sensors.Switches.MagneticSwitch" Version="0.*" />
</ItemGroup>
</Project>
21 changes: 11 additions & 10 deletions Source/MiniPIRMotionSensor/Driver/MiniPIRMotionSensor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Meadow.Foundation.Sensors.Motion;
using Meadow.Hardware;
using System;

namespace Meadow.Foundation.Grove.Sensors.Motion
{
Expand All @@ -11,35 +12,35 @@ public class MiniPIRMotionSensor : ParallaxPir
/// <summary>
/// Creates a MiniPIRMotionSensor driver
/// </summary>
/// <param name="digitalInputPort"></param>
/// <param name="digitalInputPort">The port connected to the PIR</param>
public MiniPIRMotionSensor(IDigitalInputPort digitalInputPort)
: base(digitalInputPort)
{ }

/// <summary>
/// Creates a MiniPIRMotionSensor driver
/// </summary>
/// <param name="device"></param>
/// <param name="pin"></param>
/// <param name="interruptMode"></param>
/// <param name="resistorMode"></param>
/// <param name="debounceDuration"></param>
/// <param name="glitchFilterCycleCount"></param>
/// <param name="device">The Meadow device</param>
/// <param name="pin">The pin connected to the PIR sensor</param>
/// <param name="interruptMode">The interrupt mode of the pin</param>
/// <param name="resistorMode">The resistor mode of the pin</param>
/// <param name="debounceDuration">The debounce duration</param>
/// <param name="glitchDuration">The glitch duration (can typically be set to zero)</param>
public MiniPIRMotionSensor(
IDigitalInputController device,
IPin pin,
InterruptMode
interruptMode,
ResistorMode resistorMode,
int debounceDuration = 20,
int glitchFilterCycleCount = 0)
TimeSpan debounceDuration,
TimeSpan glitchDuration)
: base(
device,
pin,
interruptMode,
resistorMode,
debounceDuration,
glitchFilterCycleCount)
glitchDuration)
{ }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\Driver\MiniPIRMotionSensor.csproj" />
<PackageReference Include="Meadow.Foundation.Grove.Sensors.Motion.MiniPIRMotionSensor" Version="0.*" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Source/MoistureSensor/Driver/MoistureSensor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<ProjectReference Include="..\..\Driver\MoistureSensor.csproj" />
<PackageReference Include="Meadow.Foundation.Grove.Sensors.Moisture.MoistureSensor" Version="0.*" />
</ItemGroup>
</Project>
Loading

0 comments on commit 38102a7

Please sign in to comment.