Book Image

Learning JavaScript Robotics

By : Kassandra Perch
Book Image

Learning JavaScript Robotics

By: Kassandra Perch

Overview of this book

Table of Contents (16 chapters)
Learning JavaScript Robotics
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Outputs that require multiple pins


There are many types of output, many of which only need one output pin for data, such as LEDs and the Piezo element that we used in the last few chapters. However, there are nearly an infinite number of output devices that we can use—many of them require more complicated instructions than one output pin is capable of sending.

These devices work in several different ways, and while the exact ways are well beyond the scope of this book, we'll go over a few very common types. For this chapter, however, we'll just go over the I2C, because it is the common format for the device that we will use in this chapter's project.

Inter-Integrated Circuits (I2C)

I2C, or Inter-Integrated Circuits, are output devices that can share the same set of two data pins. The data pins are usually called SCL (Serial Clock Line) and SDA (Serial Data Line), where SCL handles timing and SDA sends data. The reason you can wire many devices to one pair of digital output pins is because in...