This sample only works with the Windows 10 IoT Core Anniversary Update (Build 14393) release with Visual Studio 2015 and does not currently work with any newer Windows releases or Visual Studio 2017. We are looking into adding Node.js support to UWP in a future release of Windows 10 IoT Core.
Start Visual Studio 2017 and create a new project (File | New Project…). In the
New Project dialog, navigate to
Basic Node.js Johnny-Five Application (Universal Windows) template (shown below), enter a name for your project, then press OK.
Wait for the Johnny-Five package and its dependencies to complete downloading. This will be indicated by the message below in the npm output window.
Right-click on the npm node in the Solution Explorer (shown below) and select Update npm Packages. This step will run npm dedupe and update serialport (a Johnny-Five dependency) with a version that works with Node.js UWP.
Connect your Arduino and Raspberry Pi 2 or 3 with the USB cable. If your Raspberry Pi 2 or 3 is connected to a monitor, you should see the device getting recognized as shown in the image below (the name of the device may be “Arduino Uno” instead of “USB Serial Device”):
Go to the Project menu and select ‘<Your project name> Properties’ (You could also right-click on the project node in solution explorer to access Properties). Enter the IP Address in the Remote Machine text box. Since you’re building for Raspberry Pi 2 or 3, select
ARM in the dropdown menu.
Now we’re ready to deploy the app to the Raspberry Pi 2 or 3. Simply press F5 (or select Debug | Start Debugging) to start debugging the app. This step will also start rotating the motor on the servo.