In order to make the LED blink, we'll need to install the code on the Raspberry Pi, and then run it!
If you wrote your code on your desktop and need to transfer it to your Raspberry Pi, there are a couple of ways to go about it: you can use rsync
on an macOS X or Linux machine:
rsync ./blink-led.js
[email protected]:~/<project folder>/
Replace <project folder>
with the folder you want to transfer into (for example, the book folder would be hands-on-robotics-with-javascript/ch2/blink-led
).
Note
For Windows, follow the guide for installing and using WinSCP at https://winscp.net/eng/docs/ui_commander.
Once your code is on your Raspberry Pi, you'll want to switch to your SSH session and run the following, if you're using the source code from this book:
cd hands-on-robotics-with-javascript/ch2/blink-led
Otherwise, use cd
to enter the folder where you stored your blink-led.js
file on the Raspberry Pi. Then, run...