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

More about motors


A motor is a component that can rotate a shaft in continuous circles at varying speeds. However, there are many different kinds of motors; let's take a look at a few:

  • DC motor: This kind of motor is the simplest: it can go in one direction, and the speed varies by the power you give it. These usually only have two wires: one for ground and one for power; we will combine the latter with the motor hat to control the speed. With the correct controller, we can move the motor in both directions.
  • Motors with brakes: These motors have a third wire to control a brake that can stop the motor without the need to coast to a stop, as with DC motors. These motors are supported by the Johnny-Five library, but will not be covered in this book.
  • Stepper motors: Stepper motors are used for precise movements, as they move in steps that vary based on the size of the motor. They are bi-directional by design and are great where you need the torque of a motor with precision. We'll talk more about...