C H A P T E R  10

Serial and I2C

In the last chapter, we looked at how packages of commonly used code called libraries can be useful for working with a range of different kinds of hardware. Usually, these libraries are written for very specific devices or hardware that uses particular components. In this chapter, we will look at a few more libraries for working with more standardized communication protocols that can be used to communicate between many different types of devices that speak the same language. In Chapter 6 we got a taste for using hardware serial communications for monitoring an analog input, although this was a fairly basic one-way communication.

We will revisit hardware serial in this chapter, looking at different functions that can be used to not only send but receive information as well, using Project 9 Serial to Servo, for our discussion. We will then move on to serial communications using a software library instead of the Arduino's built-in hardware to expand the number of things that we can talk to with serial, including the tag reader used in Project 10 RFID Reader. After that, we should have a look at another useful serial communication in the form of the Inter-Integrated Circuit (I2C) data bus, useful for talking with other hardware devices like sensors, displays, and the real-time clock used in Project 11 Serial Time Clock.

What's needed for this chapter:

  • Arduino Uno
  • Hobby servo (Hitec HS-322 or similar)
  • Innovations ID-12 or ID-20 RFID reader and breakout board
  • Assorted 125kHz RFID tags
  • Piezoelectric speaker or LED and appropriate 220-ohm resistor
  • DS1307 real time clock breakout board (SparkFun or Adafruit both make these)
  • Hookup wires
  • Solderless breadboard
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset