Skip to content

Commit f600d6f

Browse files
committed
remove uart
1 parent af46b9a commit f600d6f

File tree

5 files changed

+9
-105
lines changed

5 files changed

+9
-105
lines changed

content/micropython/06.communication/i2c/i2c.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
---
2-
title: Communication Protocol - I2C
2+
title: Inter-Integrated Circuit (I2C)
33
description: Learn how to use I2C on Micropython
44
author: Pedro Sousa Lima
55
---
66

7-
#### Introduction
87
Inter-Integrated Circuit, or **I2C**, is one of the most widely used serial communication protocols, especially in the Arduino ecosystem. It enables multiple devices to communicate over just two wires, making it both efficient and versatile as you can easily add new modules more easily as the connections all happen across the same bus and standetizes them across manufacturers (and product lines).
98

109

11-
#### How I2C Works
10+
## How I2C Works
1211
I2C communication relies on two wires:
1312
- **SDA (Serial Data):** Transfers data between devices.
1413
- **SCL (Serial Clock):** Synchronizes data transmission.
@@ -17,14 +16,15 @@ Each device on an I2C bus has a unique address, allowing the controller to commu
1716

1817
![I2C Diagram](assets/i2c.png)
1918

19+
### Key Features of I2C
2020

21-
#### Key Features of I2C
2221
1. **Two-Wire Simplicity:** Reduces hardware complexity.
2322
2. **Address-Based Communication:** Each device has a unique address.
2423
3. **Bidirectional Communication:** Enables data transfer in both directions.
2524

2625

27-
#### Example: Reading Sensor Data Using I2C
26+
## Example: Reading Sensor Data Using I2C
27+
2828
In this example, we will connect an **LIS3DHTR accelerometer** to an Arduino and read its data via I2C.
2929

3030
**Circuit Diagram:**
@@ -40,7 +40,7 @@ In this example, we will connect an **LIS3DHTR accelerometer** to an Arduino and
4040

4141
3. Copy the following code to your `main.py` file and run it.
4242

43-
**Code:**
43+
**Code Example:**
4444
```python
4545
import lis3dh, time, math
4646
from machine import Pin, I2C
@@ -92,15 +92,16 @@ if imu.device_check():
9292
```
9393

9494
**Expected Output:**
95-
In the REPL terminal, you will see accelerometer data displayed every second. For example:
95+
In the REPL terminal, you will see accelerometer data displayed every second.
96+
9697
![Expected Output](assets/repl-i2c-sensor.gif)
9798

9899
```
99100
x = 0.001 G, y = -0.002 G, z = 1.000 G
100101
pitch = -0.12, roll = 0.04
101102
```
102103

104+
## Summary
103105

104-
#### Summary
105106
I2C is a highly efficient protocol that enables multiple devices to communicate on just two wires. In this example, we demonstrated how to read data from an I2C-connected sensor, opening the door to integrating even more devices into your Arduino projects.
106107

Binary file not shown.

content/micropython/06.communication/spi/spi.md

-54
This file was deleted.
Binary file not shown.

content/micropython/06.communication/uart/uart.md

-43
This file was deleted.

0 commit comments

Comments
 (0)