Redirecting you to Developer Center... Click here if you are not automatically redirected.

Develop with Windows Remote Arduino

Setup your hardware and software to develop with the Windows Remote Arduino library.

Overview

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:
  • Set up your Windows 10 device
  • Set up your Arduino
  • Begin developing

1. Set up your Windows 10 deviceHide


Installation

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:

  1. Install the NuGet package
  2. Manually add the Windows Remote Arduino project files to a new Visual Studio solution.

If you'd like to develop your own apps using Windows Remote Arduino, option 2 will allow you to easily add the library to any Visual Studio solution. Option 3 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!

Option 1: Install the NuGet package

NuGet is a quick and easy way to automatically install the packages and setup dependencies.

  1. Install Visual Studio
  2. Create a New Project
  3. In Visul Studio, navigate to the following menu item: Tools > NuGet Package Manager > Package Manager Console
  4. Enter the following command into the console window: Install-Package Windows-Remote-Arduino

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.

Option 2: Add the Windows Remote Arduino projects to a Visual Studio solution

Step 1: Install Visual Studio

We recommend Visual Studio Community Edition, but Visual Studio Professional 2015 and Visual Studio Enterprise 2015 will work as well (available here ). If you already have Visual Studio installed, you can proceed directly to the next step.

Step 2: Create a new project

  1. Open Visual Studio. Select File -> New Project.
  2. You can now select your language of choice. Windows Remote Arduino is a WinRT component, meaning it is compatible with C++, C#, or JavaScript - for this sample you'll want C#.
  3. 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).

Step 3: Add Windows Remote Arduino projects to your solution

  1. Clone the Windows Remote Arduino GitHub repository. If you're not familiar with Git and want to do a proper clone, follow the instructions here.
  2. Right-click on your solution in the Solution Explorer and select Add -> Existing Project.
  3. 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).
  4. 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 this directory.
  5. 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.)
  6. 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.
  7. Under the Projects tab, select all three of the Microsoft.Maker projects.
  8. Rebuild your solution by selecting Build -> Rebuild Solution.
  9. Verify you have added the necessary Device Capabilities to your project manifest. Once you've completed the section below, your device will be ready to go!

Device Capabilities

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.

    xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest"
    

Enabling Bluetooth Capabilities

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.

Windows 10

<DeviceCapability Name="bluetooth.rfcomm">
  <Device Id="any">
    <Function Type="name:serialPort"/>
  </Device>
</DeviceCapability>

Windows 8.1

<m2:DeviceCapability Name="bluetooth.rfcomm">
  <m2:Device Id="any">
    <m2:Function Type="name:serialPort"/>
  </m2:Device>
</m2:DeviceCapability>

Enabling Network Capabilities

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.

Windows 10 and Windows 8.1

<Capability Name="privateNetworkClientServer"/>
<Capability Name="internetClientServer"/>

Enabling USB Capabilities

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 2015 has 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.

Windows 10

<DeviceCapability Name="serialcommunication">
  <Device Id="any">
    <Function Type="name:serialPort"/>
  </Device>
</DeviceCapability>

Windows 8.1

Unfortunately, this library does not support USB on Windows 8.1.

2. Set up your ArduinoShow


3. DevelopShow