Book Image

Hands-On Robotics with JavaScript

By : Kassandra Perch
Book Image

Hands-On Robotics with JavaScript

By: Kassandra Perch

Overview of this book

JavaScript has an effective set of frameworks and libraries that provide support for embedded device programming and the robotics ecosystem. You’ll be able to put your JavaScript knowledge to work with this practical robotics guide. The book starts by guiding you in setting up an environment to program robots with JavaScript and Rasberry Pi 3. You will build beginner-level projects, such as a line-following robot, and then upgrade your robotics skills with a series of projects that help you get to grips with the Johnny-Five library. As you progress, you’ll learn how you can improve your projects by enabling advanced hardware components and programming concepts. You’ll even build an advanced AI-enabled robot, connect its NodeBots to the internet, create a NodeBots Swarm, and explore Message Queuing Telemetry Transport (MQTT). By the end of this book, you will have enhanced your robot programming skills by building a range of simple to complex projects.
Table of Contents (19 chapters)
Title Page
Dedication
Packt Upsell
Contributors
Preface
Index

Creating a project folder


I find the best way to organize your Raspberry Pi is to put each project in its own folder. In the source code that accompanies this book, I've done just that. But let's walk through how to set up your own project folders. First, you'll want to create the folder itself. For the project in this chapter, which we'll call led-blink, you'll want to run the following:

cd ~
mkdir led-blink

 

 

 

 

Make sure that you're running this in your SSH session to the Raspberry Pi, and not on your desktop.

Note

From here on out, unless the text directly says to run something on your desktop, you should run all of your commands in the SSH session to your Raspberry Pi that we set up inChapter 1Setting Up Your Development Environment.

Setting up npm to manage our modules

We're going to be using more than just Johnny-Five and Raspi-IO to create our projects, and you want to be able to move your code around via your favorite Git hosting service, perhaps to move it to a new Raspberry Pi, for...