Copy node.exe and chakracore.dll to C:\Node.js (ChakraCore) on your Raspberry Pi 2 or 3.
Create a file with the code to control the Arduino LED
Create new folder called “CylonSample” on your PC. Open the folder and create a new file called cylonsample.js and place the contents below to it.
Open a command window.
Navigate to the CylonSample folder (created in the previous section).
Run npm install cylon cylon-firmata cylon-gpio cylon-i2c --target_arch=arm
Copy the sample to your Raspberry Pi 2 or 3
Open up an explorer window on your PC and enter \\<IP address of your device>\C$ to access files on your device. The credentials (if you have not changed them) are:
username: <IP address or device name, default is minwinpc>\Administrator
Copy the CylonSample folder on your PC to C:\CylonSample on the Raspberry Pi 2 or 3.
Set up the connection between your Arduino and Raspberry Pi 2 or 3
Connect your Arduino and Raspberry Pi 2 or 3 with the USB cable. When you do, if your Raspberry Pi 2 or 3 is connected to a monitor,
you should see the device getting recognized like in the image below:
We also need to assign a port name to (e.g. ‘COM5’) to the Arduino. Follow these steps to do this:
In PowerShell connected to the Raspberry Pi 2 or 3, run devcon status usb*. When you do this, you should see a device similar to the one below:
Name: USB Serial Device
Driver is running.
When the device restarts, reconnect PowerShell and you can run the sample code!
Run the sample!
In PowerShell, run the command & 'C:\Node.js (ChakraCore)\Node.exe' C:\CylonSample\cylonsample.js.
After running the command, the LED (shown with the arrow in the picture below) on the Arduino should start blinking every 1 second.