first commit

This commit is contained in:
pandacraft 2025-03-21 16:04:17 +01:00
commit a5a0434432
1126 changed files with 439481 additions and 0 deletions

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -0,0 +1,160 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{1AAB0B0C-4AD6-49A7-9A1C-78ACE337A938}</ProjectGuid>
<OutputType>winmdobj</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LightSensor</RootNamespace>
<AssemblyName>LightSensor</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.10586.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<EnableDotNetNativeCompatibleProfile>true</EnableDotNetNativeCompatibleProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<AllowCrossPlatformRetargeting>false</AllowCrossPlatformRetargeting>
<PackageCertificateKeyFile>Button_TemporaryKey.pfx</PackageCertificateKeyFile>
<AppxPackage>true</AppxPackage>
<ContainsStartupTask>true</ContainsStartupTask>
<PackageCertificateThumbprint>D64B25D602A86151E47D5AA55E24A385D28F5426</PackageCertificateThumbprint>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
<None Include="Button_TemporaryKey.pfx" />
<None Include="project.json" />
</ItemGroup>
<ItemGroup>
<Compile Include="StartupTask.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
<ItemGroup>
<Content Include="Properties\Default.rd.xml" />
<Content Include="Assets\LockScreenLogo.scale-200.png">
<InProject>false</InProject>
</Content>
<Content Include="Assets\SplashScreen.scale-200.png">
<InProject>false</InProject>
</Content>
<Content Include="Assets\Square150x150Logo.scale-200.png">
<InProject>false</InProject>
</Content>
<Content Include="Assets\Square44x44Logo.scale-200.png">
<InProject>false</InProject>
</Content>
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png">
<InProject>false</InProject>
</Content>
<Content Include="Assets\StoreLogo.png">
<InProject>false</InProject>
</Content>
<Content Include="Assets\Wide310x150Logo.scale-200.png">
<InProject>false</InProject>
</Content>
</ItemGroup>
<ItemGroup>
<Reference Include="GrovePi, Version=1.0.7.0, Culture=neutral, processorArchitecture=ARM">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\GrovePi\bin\ARM\Debug\GrovePi.dll</HintPath>
</Reference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -0,0 +1,45 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LightSensor", "LightSensor.csproj", "{1AAB0B0C-4AD6-49A7-9A1C-78ACE337A938}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DC9CE5B0-5F88-4AFC-9F7A-CBCB69B6DFD7}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1AAB0B0C-4AD6-49A7-9A1C-78ACE337A938}.Debug|ARM.ActiveCfg = Debug|ARM
{1AAB0B0C-4AD6-49A7-9A1C-78ACE337A938}.Debug|ARM.Build.0 = Debug|ARM
{1AAB0B0C-4AD6-49A7-9A1C-78ACE337A938}.Debug|ARM.Deploy.0 = Debug|ARM
{1AAB0B0C-4AD6-49A7-9A1C-78ACE337A938}.Debug|x64.ActiveCfg = Debug|x64
{1AAB0B0C-4AD6-49A7-9A1C-78ACE337A938}.Debug|x64.Build.0 = Debug|x64
{1AAB0B0C-4AD6-49A7-9A1C-78ACE337A938}.Debug|x64.Deploy.0 = Debug|x64
{1AAB0B0C-4AD6-49A7-9A1C-78ACE337A938}.Debug|x86.ActiveCfg = Debug|x86
{1AAB0B0C-4AD6-49A7-9A1C-78ACE337A938}.Debug|x86.Build.0 = Debug|x86
{1AAB0B0C-4AD6-49A7-9A1C-78ACE337A938}.Debug|x86.Deploy.0 = Debug|x86
{1AAB0B0C-4AD6-49A7-9A1C-78ACE337A938}.Release|ARM.ActiveCfg = Release|ARM
{1AAB0B0C-4AD6-49A7-9A1C-78ACE337A938}.Release|ARM.Build.0 = Release|ARM
{1AAB0B0C-4AD6-49A7-9A1C-78ACE337A938}.Release|ARM.Deploy.0 = Release|ARM
{1AAB0B0C-4AD6-49A7-9A1C-78ACE337A938}.Release|x64.ActiveCfg = Release|x64
{1AAB0B0C-4AD6-49A7-9A1C-78ACE337A938}.Release|x64.Build.0 = Release|x64
{1AAB0B0C-4AD6-49A7-9A1C-78ACE337A938}.Release|x64.Deploy.0 = Release|x64
{1AAB0B0C-4AD6-49A7-9A1C-78ACE337A938}.Release|x86.ActiveCfg = Release|x86
{1AAB0B0C-4AD6-49A7-9A1C-78ACE337A938}.Release|x86.Build.0 = Release|x86
{1AAB0B0C-4AD6-49A7-9A1C-78ACE337A938}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:iot="http://schemas.microsoft.com/appx/manifest/iot/windows10" IgnorableNamespaces="uap mp iot">
<Identity Name="LightSensor-uwp" Publisher="CN=Dexter Industries Dev" Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="0e29ae6c-d965-4f75-9387-70a777ae7169" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>LightSensor</DisplayName>
<PublisherDisplayName>DexterIndustries</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App">
<uap:VisualElements DisplayName="LightSensor" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="Demonstrate using the Light Sensor with GrovePi and WinIOT." BackgroundColor="transparent" AppListEntry="none">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png">
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
<Extensions>
<Extension Category="windows.backgroundTasks" EntryPoint="LightSensor.StartupTask">
<BackgroundTasks>
<iot:Task Type="startup" />
</BackgroundTasks>
</Extension>
</Extensions>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>

View file

@ -0,0 +1,32 @@
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("LightSensor")]
[assembly: AssemblyDescription("Demonstrates using the Grove LightSensor with the GrovePi.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Dexter Industries")]
[assembly: AssemblyProduct("GrovePi")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("GrovePi")]
[assembly: AssemblyCulture("Counter")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]
[assembly: NeutralResourcesLanguage("")]

View file

@ -0,0 +1,31 @@
<!--
This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
developers. However, you can modify these parameters to modify the behavior of the .NET Native
optimizer.
Runtime Directives are documented at http://go.microsoft.com/fwlink/?LinkID=391919
To fully enable reflection for App1.MyClass and all of its public/private members
<Type Name="App1.MyClass" Dynamic="Required All"/>
To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
Using the Namespace directive to apply reflection policy to all the types in a particular namespace
<Namespace Name="DataClasses.ViewModels" Seralize="All" />
-->
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Application>
<!--
An Assembly element with Name="*Application*" applies to all assemblies in
the application package. The asterisks are not wildcards.
-->
<Assembly Name="*Application*" Dynamic="Required All" />
<!-- Add your application specific runtime directives here. -->
</Application>
</Directives>

View file

@ -0,0 +1,88 @@
## **Light Sensor Sample**
This sample will demonstrate how to use the [Grove Light Sensor](http://www.dexterindustries.com/shop/grove-light-sensor/) with the [Dexter Industries GrovePi](http://www.dexterindustries.com/product-category/robots/grovepi/) to create a basic reading of light levels. This sample is designed to run on a Raspberry Pi 2 running Windows 10 IoT Core. The application is written as a Background Task and will run in Windows 10 IoT Core without any user interface.
### Requirements
You must have the following:
- [Windows 10](https://www.microsoft.com/windows/)
- [Visual Studio 2015 Community Edition](https://www.visualstudio.com/) or better
- [Raspberry Pi 2 running Windows 10 IoT Core](http://ms-iot.github.io/content/en-US/win10/RPI.htm)
- [GrovePi+ Starter Kit for Raspberry Pi](http://www.dexterindustries.com/grovepi-starter-kit/)
### Install a Visual Studio 2015
If you don't already have one installed, install Visual Studio 2015. You can use the free Community edition, or any other higher edition. When you are installing Visual Studio, you must do a __Custom__ install and select to install the __Universal Windows App Development Tools -> Tools and Windows SDK__.
After the installation is complete, install the Windows IoT Core Project Templates from [here](https://visualstudiogallery.msdn.microsoft.com/55b357e1-a533-43ad-82a5-a88ac4b01dec).
### Enable Developer Mode on your Windows 10 Development Device
When you are developing on Windows 10, you choose what tasks you want to enable on the device. This includes any devices - Windows 10 desktops, tablets and phones. You can enable a device for development, or just app side loading. To enable _Developer mode_ on your Windows 10 device:
1. Click the Windows icon (typically in the lower-left of the screen, on the left-most side of the toolbar).
2. Type __Update__ and select _Windows Update settings_ from the _Best match_ list. This will open the __UPDATE & SECURITY__ settings page.
3. Click on __For developers__ in the left sidebar.
4. Ensure the __Developer mode__ radio button is selected.
5. Save your changes and close the _Settings_ window.
### Build the Samples
Download the GrovePi repository to your development PC.
Each sample is its own solution. There are two ways to run the sample projects - within the GrovePi solution, or as individual solutions.
#### Samples as Part of GrovePi solution (recommended)
When you run the samples as part of the GrovePi solution you know that you are using the very latest build of GrovePi, however; the samples are not part of the GrovePi solution by default - you must add them.
1. Open __GrovePi\Software\CSharp\GrovePi.sln__ in Visual Studio
2. Right-click on the solution in the _Solution Explorer_
3. Select __Add__ > __ New Solution Folder__
4. Name the folder __Samples__
5. Right-click on the solution in the _Solution Explorer_
6. Select __Add__ > __ Existing Project__
7. Find the __LightSensor.csproj__ file - select it and click __Open__
This will add the _LightSensor_ project to you new _Samples_ directory.
In the _LightSensor_ project you need to update the reference to _GrovePi_.
1. In _Solution Explorer_ expand the _LightSensor_ project and the _References_ node.
2. Right-click on the __GrovePi__ reference and click __Remove_
3. Right-click on the __References__ node and choose __Add Reference__
4. Expand the __Projects__ node
5. Select (by checking the check box) the __GrovePi__ project.
6. Click __OK__
The project should now have all the updated references you need.
#### Samples as Independent Solutions
When you run the sampels as independent solutions, you need to ensure you are referencing a current version of the GrovePi assembly (likely more current than the one available as a NuGet package).
The following steps assume you have already opened _GrovePi\Software\CSharp\GrovePi.sln_ in Visual Studio and built the solution. To build the solution, open GrovePi.sln, and click on press CTRL + SHIFT + B. Then close GrovePi.sln.
After building the GrovePi solution:
1. Open __GrovePi\Software\CSharp\Samples\LightSensor.sln__ in Visual Studio.
2. In _Solution Explorer_ expand the _LightSensor_ project and the _References_ node.
3. Right-click on the __GrovePi__ reference and click __Remove_.
4. Right-click on "References" and click "Add Reference".
5. Select the __Browse__ tab and click the __Browse__ button.
6. Browse to __GrovePi\Software\CSharp\GrovePi\bin\ARM\Debug__ and select the __GrovePi.dll__ file
7. Click __OK__
The project should now have all the updated references you need.
### Setup the Hardware
For this sample, connect the following:
1. Light Sensor to __A0__ (Analog Pin 0)
### Run the Sample
To run the sample...
1. Right-click on the _LightSensor_ project in the _Solution Explorer_
2. Select __Set as Startup Project__
3. Right-click on the __Properties__ node under _LightSensor_ and select __Open__
4. Select the __Debug__ tab
5. Select __Remote Machine__ in the _Target device_ field
6. In the __Remote Machine__ field, Type in the name or IP Address of your Windows 10 IoT Core Raspberry Pi
7. Press __Ctrl__ + __S__ (this file will not be saved automatically, you must save it manually).
8. Press __F5__ to launch the debugger (it will take a minute or two to deploy your app onto the Raspberry Pi).

View file

@ -0,0 +1,73 @@
// Light Sensor Demonstration for the GrovePi.
// This example combines the GrovePi and the Grove LightSensor using the Raspberry Pi and GrovePi.
// http://www.dexterindustries.com/shop/grovepi-board/
// http://www.dexterindustries.com/shop/grove-LightSensor/
// Connct the Light Sensor to Analog Port 0 on the GrovePi.
/*
The MIT License(MIT)
GrovePi for the Raspberry Pi: an open source platform for connecting Grove Sensors to the Raspberry Pi.
Copyright (C) 2016 Dexter Industries
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
using System;
using Windows.ApplicationModel.Background;
// Add using statements to the GrovePi libraries
using GrovePi;
using GrovePi.Sensors;
namespace LightSensor
{
public sealed class StartupTask : IBackgroundTask
{
public void Run(IBackgroundTaskInstance taskInstance)
{
// Connect the Light Sensor to analog port 0
ILightSensor sensor = DeviceFactory.Build.LightSensor(Pin.AnalogPin0);
// Loop endlessly
while (true)
{
try
{
// Check the value of the button, turn it into a string.
string sensorvalue = sensor.SensorValue().ToString();
System.Diagnostics.Debug.WriteLine("Sensor is " + sensorvalue);
}
catch (Exception ex)
{
// NOTE: There are frequent exceptions of the following:
// WinRT information: Unexpected number of bytes was transferred. Expected: '. Actual: '.
// This appears to be caused by the rapid frequency of writes to the GPIO
// These are being swallowed here/
// If you want to see the exceptions uncomment the following:
// System.Diagnostics.Debug.WriteLine(ex.ToString());
}
}
}
}
}

View file

@ -0,0 +1,16 @@
{
"dependencies": {
"Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0"
},
"frameworks": {
"uap10.0": {}
},
"runtimes": {
"win10-arm": {},
"win10-arm-aot": {},
"win10-x86": {},
"win10-x86-aot": {},
"win10-x64": {},
"win10-x64-aot": {}
}
}

File diff suppressed because it is too large Load diff