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

Chapter 9


  1. The Pi is well-suited for projects that require remote data because of its onboard ability to connect to the internet via either WiFi or Ethernet.
  2. The considerations that need to be taken when making regular web requests from the Pi are:
    • The size of the payload
    • How much CPU parsing the payload will take
    • Whether the data being accessed was meant to be accessed
    • WiFi requests take a lot of power for the Pi and can cause problems if the Pi doesn't have a proper power supply
  3. We can chain the LCD object calls, such as LCD.clear().home() because the Johnny-Five Objects always return the instance of the Object the method was working on, so another method can be called on it.
  4. We use an I2C backpack with our LCD to cut the number of needed wires and pins from 8 to 2, and eliminate the need to hook up our own potentiometer to adjust LCD contrast.
  5. We would need more components to use the LCD without the backpack—we would need a potentiometer to control the contrast of the LCD.
  6.  LCD.on() does not turn on the entire LCD, instead, it turns on the LCD backlight.