My Account Log in

4 options

Hands-on robotics with JavaScript : build robotic projects using Johnny-five and control hardware with Javascript and Raspberry Pi / Kassandra Perch.

EBSCOhost Academic eBook Collection (North America) Available online

View online

EBSCOhost Ebook Public Library Collection - North America Available online

View online

Ebook Central College Complete Available online

View online

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Perch, Kassandra, author.
Language:
English
Subjects (All):
Robots--Programming.
Robots.
JavaScript (Computer program language).
Physical Description:
1 online resource (206 pages) : illustrations
Edition:
1st edition
Place of Publication:
Birmingham ; Mumbai : Packt, 2018.
System Details:
text file
Biography/History:
Perch Kassandra: Kassandra Perch is an open web developer and supporter. She began as a frontend developer and moved to server-side with the advent of Node. js and was especially enthralled by the advance of the NodeBots community. She travels the world speaking at conferences about NodeBots and the fantastic community around them.
Summary:
Leverage Raspberry Pi 3 and different JavaScript platforms to build exciting Robotics projects Key Features Build robots that light up and make noise Learn to work with Raspberry Pi 3 and JavaScript Connect your Johnny-Five projects to external APIs and create your own IoT Book Description There has been a rapid increase in the use of JavaScript in hardware and embedded device programming. JavaScript has an effective set of frameworks and libraries that support the robotics ecosystem. Hands-On Robotics with JavaScript starts with setting up an environment to program robots in JavaScript. Then, you will dive into building basic-level projects such as a line-following robot. You will walk through a series of projects that will teach you about the Johnny-Five library, and develop your skills with each project. As you make your way through the chapters, you'll work on creating a blinking LED, before moving on to sensors and other more advanced concepts. You will then progress to building an advanced-level AI-enabled robot, connect their NodeBots to the internet, create a NodeBots Swarm, and explore MQTT. By the end of this book, you will have gained hands-on experience in building robots using JavaScript What you will learn Install and run Node.js and Johnny-Five on Raspberry Pi Assemble, code, and run an LED project Leverage JavaScript libraries to build exciting robots Use sensors to collect data from the world around you Employ servos and motors to make your project move Add internet capabilities to your Johnny-Five project Who this book is for Hands-On Robotics with JavaScript is for individuals who have prior experience with Raspberry Pi 3 and like to write sketches in JavaScript. Basic knowledge of JavaScript and Node.js will help you get the most out of this book.
Contents:
Cover
Title Page
Copyright and Credits
Dedication
Packt Upsell
Contributors
Table of Contents
Preface
Chapter 1: Setting Up Your Development Environment
Technical requirements
What is the Raspberry Pi?
Microcontrollers
General-Purpose Input/Output (GPIO) pins
Debian and Raspbian
Johnny-Five and Raspi-IO
So, the Pi is technically a microcontroller...
...but it is also a computer!
How we will use the Raspberry Pi
Taking advantage of all that the Raspberry Pi has to offer!
Johnny-Five - letting us code hardware in Node.js
Installing the operating system
Downloading Raspbian Lite
Burning the image to an SD card
Editing files on the SD card
Booting up the Pi
SSHing from a Linux or Mac
SSHing from Windows
Setting up your password and hardware interfaces
First things first - change your password!
Updating the Raspberry Pi
Turning on the hardware interfaces
Installing Node.js, Johnny-Five, and Raspi-IO
Installing Node.js and npm
Detecting your version of ARM processor
Installing Johnny-Five and Raspi-IO
Summary
Questions
Further reading
Chapter 2: Creating Your First Johnny-Five Project
Creating a project folder
Setting up npm to manage our modules
Getting started with Johnny-Five and Raspi-IO
Gathering resources and documentation
Taking a look at the LED-blink project
Raspberry Pi pin numbers
Wiring up an LED
Putting together and attaching the cobbler
Attaching the resistor and LED
Making the LED blink
Putting your code on the Raspberry Pi
Running your code
Chapter 3: Building Interactive Projects with RGB LED
Looking at the LED and LED.RGB API
The LED object
The Led.RGB object.
PWM pins and GPIO expanders
How do PWM pins work?
Why we need a GPIO expander
Wiring up our GPIO expander and RGB LED
Bringing in other node packages
Project - building a rainbow
Using the color npm module
Getting our Johnny-Five code started
The REPL - a powerful tool in Johnny-Five
How does the REPL work?
Adding our RGB LED to the REPL
Controlling our LED from the command-line interface
Chapter 4: Bringing in Input with Buttons
Using inputs in robotics projects
Digital versus analog input
How to handle analog input with the Raspberry Pi
Analog GPIO expanders
Using input devices with digital interfaces
How Johnny-Five handles input
The structure of a typical Johnny-Five project
The beginning - including libraries and creating our board object
The board ready event handler
Constructing our component objects
Input event handlers and output device manipulation
The Johnny-Five button object
The button object
Button events
Wiring up buttons
Putting a button on a breadboard
Using a pull-down resistor
Adding buttons to our RGB LED project
Wiring everything up
Using the power and ground side rails
Wiring up the buttons
Button 1 - stop and start rainbow
Refactoring the rainbow cycle
Button 2 - next color
Chapter 5: Using a Light Sensor to Create a Night-Light
Using an analog sensor with the Pi
Finding the right sensors for your Pi project
I2C devices
SPI
How to determine if your sensor will work with Johnny-Five
The ambient light sensor
Wiring up the sensor
Writing a program to get readings and print them to the command line
The Johnny-Five sensor events.
Handling sensor data in the event handler
Using and formatting Johnny-Five sensor data
Using .scaleTo() and .fscaleTo() to fine-tune measurements
Printing sensor data to the command line
Using barcli to make the data easier to see
Importing barcli and constructing our barcli graph
Getting the bar graph to update
Creating our night-light
Wiring up the LED
Coding this project
Chapter 6: Using Motors to Move Your Project
More about motors
How to control a motor with a microcontroller
Preparing for a motor-driven project with Raspberry Pi
Putting the hat together
Putting the hat on the Pi
The Johnny-Five motor object
Constructors for our hat
Functions that move the motor
Adding REPL control
Loading and running your motor
Troubleshooting your motorized projects
Project - cat toy
Putting a piece of paper on the motor shaft
Coding the randomness to start/stop the motor
Project - using two gearbox motors and the motors object
Wiring up your TT motors
The motors Johnny-Five object
Writing some functions
Running our motors project
Chapter 7: Using Servos for Measured Movement
Differences between motors and servos
Calculated movements
Regular versus continuous servos
Powering servos and motors
Getting a servo working with Johnny-Five
The Johnny-Five servo object
Wiring the servo to our PWM hat
Coding your first servo sweep
Project - two servos and the REPL
Wiring up a second servo
Using the Johnny-Five servos object
Adding the Servos object to our code
Adding in REPL functionality
Playing with our servos on the command line
Project - light meter with the servo
Adding in the light sensor.
Making the servo into a meter
Coding the project
Running and using our light meter
Project - the continuous servo
Wiring up the servo
Continuous servo constructor and methods
Using the REPL with the continuous servo
Playing with the continuous servo in the REPL
Chapter 8: The Animation Library
Animating movement
Why we need the animation library
Moving servos with true precision
Implicit use of the animation library
Using servo.to() to implicitly create an animation
Playing with implicit animations
Playing with implicit animations, take two
The terminology of the animation library
The construction of the animation object
Creating the animation object
Planning out the animation sequence
Creating keyframes
Using null and false as positions in keyframes
Programming our keyframes
Setting cue points and duration
Putting it all together to make an animation
Watching your animation at work
Easing into your servo animations
How easing fits into an animation segment
Adding easing to our first animation
Easing an entire animation segment
Learning more about queuing and playing animation segments
Looping animation segments
Changing the speed of animation segments
Playing, pausing, and stopping animation segments
Tying it all together in the REPL
Chapter 9: Getting the Information You Need
Why connect your NodeBots to the internet?
Using the power of npm modules
Using the data you collect
Some things to keep in mind
Getting weather data on our Pi with OpenWeatherMap
Getting an OpenWeatherMap API key
Bringing in request
Parsing the response
Building a weather dashboard with an LCD
Adding an LCD to the Pi
The LCD object.
Constructing our LCD
Setting up the LCD
Printing to and clearing the LCD
Coding it all together
Project - scraping data from websites with your Pi
Scraping downforeveryoneorjustme.com for johnny-five.io
Making the HTTP request
Using Cheerio to get the element we want
Parsing the HTML and showing the result
Chapter 10: Using MQTT to Talk to Things on the Internet
IoT device communications
Long polling
Websockets
MQTT - an IoT PubSub protocol
The basics of MQTT
Setting up MQTT on the Pi with AdafruitIO
Creating an account and a feed
Subscribing to the feed using the mqtt npm module
The mqtt module
The dotenv module
Testing our connection
Project - adding an LCD and button to see and send MQTT events
Wiring it all up
Project - social media notifier bot with IFTTT
Getting started with IFTTT
Linking IFTTT to Adafruit
Setting up feeds for your social media MQTT messages in AdafruitIO
Creating our IFTTT Applets
Wiring up our project
Coding our social media notifications to show on the LCD
Running your social media bot
Chapter 11: Building a NodeBots Swarm
Project - connecting multiple NodeBots
Optional - setting up a second Raspberry Pi
Setting up your project files and folders
If you're using one Pi
If you're using two Pis
Adding a light sensor to the Pi
Creating an MQTT broker on the Pi
Programming the MQTT client - have the Pi Report Home
Running our MQTT project
Expanding your NodeBots knowledge
Using Johnny-Five on other boards
Figuring out pin numbers.
Checking the platform support page.
Notes:
Includes index.
Includes bibliographical references.
Description based on print version record.
ISBN:
9781789346732
1789346738
OCLC:
1055555805

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account