Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Hands-On Robotics with JavaScript

You're reading from   Hands-On Robotics with JavaScript Build robotic projects using Johnny-Five and control hardware with JavaScript and Raspberry Pi

Arrow left icon
Product type Paperback
Published in Aug 2018
Publisher Packt
ISBN-13 9781789342055
Length 214 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Kassandra Perch Kassandra Perch
Author Profile Icon Kassandra Perch
Kassandra Perch
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Setting Up Your Development Environment 2. Creating Your First Johnny-Five Project FREE CHAPTER 3. Building Interactive Projects with RGB LED 4. Bringing in Input with Buttons 5. Using a Light Sensor to Create a Night-Light 6. Using Motors to Move Your Project 7. Using Servos for Measured Movement 8. The Animation Library 9. Getting the Information You Need 10. Using MQTT to Talk to Things on the Internet 11. Building a NodeBots Swarm 12. Assessments 13. Other Books You May Enjoy

Setting up your password and hardware interfaces

Now that we have our Raspberry Pi connected to the Wi-Fi and we're SSHed in, we need to make a few changes before we install Node.js and get started with our coding.

First things first – change your password!

When you log in, your Raspberry Pi will warn you that having SSH enabled with the default username and password isn't very secure, and it's absolutely right! The first step is to change our password.

In order to do so, in your SSH window, type in passwd and hit Enter. You'll be prompted for your current password (raspberry) and a new password. Type in whatever you like (just don't forget it)! You'll be asked to confirm it, and voila! The new password is set, as shown in the following screenshot. Your Raspberry Pi will be much more secure:

Changing your Pi password

Updating the Raspberry Pi

Next, you'll make sure that the Raspberry Pi is updated and ready to go by running the following command:

sudo apt-get update && sudo apt-get upgrade

This will take a while, but it's worth it to make sure everything is properly updated.

Turning on the hardware interfaces

Next, we'll set up the Raspberry Pi so that our hardware code can run. Run the following command:

sudo raspi-config

You'll be greeted with a graphical menu with lots of different options, as shown in the following screenshot:

The raspi-config menu

You'll want to use the arrow keys to select Interfacing Options, and then select I2C and Yes to turn it on. Repeat for SPI, then use Tab to close the menu. When it prompts you to reboot, say Yes, then SSH back in, because you're ready to install Node.js, Johnny-Five, and Raspi-IO!

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime