Arduino and Raspberry Pi Working Together (Part 2): Now With I2C

Arduino and Raspberry Pi Working Together (Part 2): Now With I2C

http://ift.tt/2qQSwm2

The easiest way to connect our Arduino board to our Raspberry Pi is using a USB cable, but sometimes this communication is a nightmare, especially because there isn’t any clock signal to synchronize our devices and we must rely on the bitrate. There are different ways to connect our Arduino and our Raspberry Pi, such as I2C, SPI, and serial over GPIO. Today, we’re going to speak about I2C, especially because it’s pretty straightforward if we take care of a couple of things. Let’s start.

I2C uses two lines — SDA (data) and SCL (clock) — in addition to GND (ground). SDA is bidirectional, so we need to ensure one way or another who is sending data (master or slave). With I2C, only the master can start communications. The master also controls the clock signal. Each device has a 7-bit direction, so we can connect 128 devices to the same bus.

java

via DZone.com Feed https://dzone.com

May 23, 2017 at 07:39AM

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s