The Windows Remote Arduino library is easy to get started with - follow the guide below to start developing with the technology. To get started, there are three simple steps to follow:
This section of the tutorial explains how to setup your Windows 10 device - be it a PC, Surface, or Windows Phone - to remotely control an Arduino using the Windows Remote Arduino library.
There are two ways to get started using Windows Remote Arduino:
If you'd like to develop your own apps using Windows Remote Arduino, option 1 will allow you to easily add the library to any Visual Studio solution. Option 2 is more complex, but will allow you to add the latest source code directly to your solution. You will then be able to see and control exactly how the library operates!
NuGet is a quick and easy way to automatically install the packages and setup dependencies.
As an alternative to step 4 above, you can also select Manage NuGet packages for Solution under the NuGet Package Manager context menu and manually search for and install Windows Remote Arduino. Visit https://www.nuget.org/packages/Windows-Remote-Arduino for more information on this package.
Once you're done with this section, skip to the Device Capabilities section to finish setting up the application.
We recommend Visual Studio Community Edition, but Visual Studio Professional 2017 and Visual Studio Enterprise 2017 will work as well (available here ). If you already have Visual Studio 2017 installed, you can proceed directly to the next step.
Open Visual Studio. Select File -> New Project.
You'll see I have chosen C# by expanding the Visual C# menu. Select the Windows option and choose Blank App (Windows Universal). If you are building for Windows 8.1, you'll want Blank App (Windows 8.1 Universal).
Right-click on your solution in the Solution Explorer and select Add -> Existing Project.
Navigate to your local copy of the repository. You'll see here that I've cloned it to C:\git\remote-wiring, but you can choose a different directory. Then, open the appropriate solution folder for your build environment (either Windows 10 or Windows 8.1).
We need to add three projects - Microsoft.Maker.Firmata, Microsoft.Maker.RemoteWiring, and Microsoft.Maker.Serial - to the project solution. Let's start with the Serial project (Microsoft.Maker.Serial). Open the source\Serial\Microsoft.Maker.Serial.win10 folder and add Microsoft Microsoft.Maker.Serial.vcxproj to the solution.
Select the *.vcxproj* file. (If you are targeting Windows 8.1, you will first have to choose between Windows and Windows Phone platform directories. You do not have to do this for Windows 10, as it is Universal to all platforms.)
Repeat the previous steps for all three Microsoft.Maker projects. Once they've all been added to your solution, right-click on References in the original project you made, not one of the newly added Microsoft.Maker projects. Select Add Reference.
Under the Projects tab, select all three of the Microsoft.Maker projects.
Rebuild your solution by selecting Build -> Rebuild Solution.
Each Windows project will contain a manifest file that must be configured to allow certain permissions, such as Bluetooth and USB connectivity. Fortunately, it is fairly easy to configure these.
You will need to open the package.appxmanifest file of your project by right-clicking the file and selecting the "View Code" option. Then, find the <Capabilities> tag and insert the relevant code snippets from the "Enabling Bluetooth Capabilities", "Enabling Network Capabilities", and "Enabling USB Capabilities" subsections below.
NOTE: For Windows 8.1, you will need to add the following namespace to the top of the XML file, inside the <Package> tag.
In order to invoke the Bluetooth capabilities of a WinRT application, you must add the relevant DeviceCapability tags below inside the <Capabilities> tag of the Package.appxmanifest file.
In order to invoke the network socket capabilities of a WinRT application, you will need to add the following code inside the <Capabilities> tag of the Package.appxmanifest file.
In order to invoke the USB capabilities of a WinRT application, you must add the relevant DeviceCapability tags below inside the <Capabilities> tag of the Package.appxmanifest file.Visual Studio 2017 had a known bug in the Manifest Designer (the visual editor for appxmanifest files) that affects the serialcommunication capability. If your appxmanifest adds the serialcommunication capability, modifying your appxmanifest with the designer will corrupt your appxmanifest (the Device xml child will be lost). You can workaround this problem by hand editting the appxmanifest by right-clicking your appxmanifest and selecting View Code from the context menu.