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

Technical requirements


In order to get started, you'll need the following:

  • A Raspberry Pi 3: Either the original or model B is fine. 
  • A power supply: Plugging the Raspberry Pi into a USB port on your computer can cause serious issues because it cannot supply enough power to allow the Raspberry Pi to function properly, so you'll need a proper wall wart power supply.
  • MicroSD card: This needs to have at least 8 GB to hold the Raspbian OS and the code we're going to write. You'll also need a way to write to the SD card from your computer—either a full SD card adapter or a USB card reader.
  • A PC9685 GPIO expansion board: There are expansion boards that require assembly on Adafruit (https://www.adafruit.com/product/815), but if you're not confident in your soldering, then there are plenty of preassembled ones available on Amazon if you search for PC9685.
  • Text editor: Your code editor will be fine; we just need to edit a few files on the SD card once we've burned the OS image onto it.

If this is your first foray into a hardware project, I suggest getting a kit that contains at least the following items, as it will help you finish many of the projects in this book, and will provide you with the parts to create your own designs:

  • Pi Cobbler
  • Resistors
  • LEDs
  • A servo
  • A motor
  • Buttons
  • Other sensors and peripherals

The following are some good examples of these items (at the time of writing):