-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from WildernessLabs/bugfix
Bugfix
- Loading branch information
Showing
7 changed files
with
238 additions
and
169 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
Source/Samples/MBus_Feather_Sample/MBus_Feather_Sample.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project Sdk="Meadow.Sdk/1.1.0"> | ||
<PropertyGroup> | ||
<RepositoryUrl>https://github.com/WildernessLabs/Meadow.Foundation</RepositoryUrl> | ||
<Company>Wilderness Labs, Inc</Company> | ||
<Authors>Wilderness Labs, Inc</Authors> | ||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> | ||
<TargetFramework>netstandard2.1</TargetFramework> | ||
<OutputType>Library</OutputType> | ||
<AssemblyName>App</AssemblyName> | ||
<LangVersion>10</LangVersion> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\..\Meadow.Core\source\implementations\f7\Meadow.F7\Meadow.F7.csproj" /> | ||
<ProjectReference Include="..\..\Devices\RelayMBus\PadPulsM2\Driver\PadPulsM2.csproj" /> | ||
<ProjectReference Include="..\..\Driver\Meadow.MBus.csproj" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using Meadow.Devices; | ||
using Meadow.Foundation.MBus.RelayMBus; | ||
using Meadow.Hardware; | ||
using System.Threading.Tasks; | ||
|
||
namespace Meadow.Foundation.MBus.MBus_Feather_Sample; | ||
|
||
|
||
public class MBM55R : MBusSerialServer | ||
{ | ||
public MBM55R(ISerialPort port) | ||
: base(port) | ||
{ | ||
port.BaudRate = 9600; | ||
port.Parity = Parity.Even; | ||
port.Open(); | ||
} | ||
} | ||
|
||
public class MeadowApp : App<F7FeatherV2> | ||
{ | ||
//<!=SNIP=> | ||
private PadPulsM2 pulseCounter; | ||
|
||
public override Task Initialize() | ||
{ | ||
Resolver.Log.Info("Initialize..."); | ||
|
||
var port = Device.PlatformOS.GetSerialPortName("com1").CreateSerialPort(9600, parity: Parity.Even); | ||
|
||
var mbm = new MBM55R(port); | ||
pulseCounter = new PadPulsM2(mbm); | ||
pulseCounter.StartMonitoring(); | ||
|
||
Resolver.Log.Info($"Counter ports: {pulseCounter.Ports[0].ID} {pulseCounter.Ports[1].ID}"); | ||
|
||
return base.Initialize(); | ||
} | ||
|
||
public override async Task Run() | ||
{ | ||
Resolver.Log.Info("Run"); | ||
|
||
while (true) | ||
{ | ||
Resolver.Log.Info($"now: {pulseCounter.Ports[0].CurrentDateTime}"); | ||
await Task.Delay(2000); | ||
} | ||
|
||
} | ||
|
||
//<!=SNOP=> | ||
} |