O'Reilly logo

Learning JavaScript Robotics by Kassandra Perch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Using Input Devices and Sensors

We've handled outputs, but what makes robots truly interesting is the use of inputs to generate outputs! In this chapter, we'll go over basic input devices, such as buttons, and environmental sensors, such as a sensor that detects ambient light. We'll talk about how Johnny-Five uses events to make these devices easy to use, and build some projects. After finishing this chapter, you should have all the knowledge that you need to handle most input/output projects.

This chapter will cover the following topics:

  • How analog input pins work
  • Johnny-Five's sensor events
  • Using basic inputs – buttons and potentiometers
  • Using sensors – light and temperature
  • Other types of sensors and their uses

What you'll need for this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required