Skip to content

2. First Steps

Eric Chavez edited this page Feb 7, 2023 · 9 revisions

I2C

I2C, a serial communication interface and protocol, establishes the physical connections and data frame for the exchange of bits between two digital devices. SDA and SCL, two communication wires, are present at the port. Additionally, the protocol for 127 slave devices to be connected over these two lines at rates of up to 100, 400, and 1000 kbit/s. The Two Wire Interface, or IIC, is another name for it.

One of the most popular protocols for connecting to digital sensors is I2C since, unlike Serial ports, it has features including allowing data confirmation inside the same frame.

One of the key benefits is the ability to link so many devices to a single bus. In addition, I2C has more bits in its communication frame than other serial protocols like Serial TTL, enabling it to send messages that are more comprehensive and informative.

Along with the information byte, messages delivered via an I2C connection also contain addresses for the register and the sensor. The gadget will always confirm that it has received the information you have supplied. This makes it important to distinguish between the many components of this kind of communication.

Installing Arduino IDE

Download Arduino IDE

The Arduino Integrated Development Environment - or Arduino Software (IDE) - contains a text editor for writing code, a message area, a text console, a toolbar with buttons for common functions, and a series of menus. The Arduino Software allows you to write programs and upload them to your board.

First, you'll need to download and install the Arduino IDE, which you can find here available on different O.S. If needed, especific instructions are mentioned here

After installing the Arduino IDE you should see the next window.

IDE

After installing the Arduino IDE, it will be essential to install the library in order to start utilizing the MPU6050. Don't worry, it's nothing to worry about; here we will provide you a tutorial so you can see how to install it.

Install the MPU6050 Library

To do this is necessary to move your mouse to the menu and select “Sketch”, select “Include Library” from the list, and click on “Manage Libraries”.

206310817-667e307b-455e-4af7-980b-3fe4dadf5e8c

A new window will open, in this part, you need to write “MPU6050” the same way as how next image.

MPU6050

The library that you have to look for is the one that has to say "by Electronic Cats", as in the following image.

by electronic cats

After finding the library, it is necessary to press the button “Install”. Install the latest version.

And that's all there is to it; you already own everything necessary to begin programming using our library.