Skip to content

Commit e32b6d5

Browse files
committed
I2C section extended
1 parent 466e33a commit e32b6d5

File tree

2 files changed

+7
-3
lines changed
  • content/hardware/05.pro-solutions/solutions-and-kits/edge-control/tutorials/user-manual

2 files changed

+7
-3
lines changed
118 KB
Loading

content/hardware/05.pro-solutions/solutions-and-kits/edge-control/tutorials/user-manual/content.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,10 @@ The Edge Control supports I2C communication, which allows data transmission betw
11241124

11251125
The NINA-B306 has two I2C ports, the I2C_1 is the one shared with the internal components and the MKR1 header, and the I2C_2 is exclusively connected to the MKR2 header.
11261126

1127+
![Edge Control I2C Pins on MKR Connectors](assets/i2c-pins.png)
1128+
1129+
***Use `Wire` to communicate with MKR1 (I2C_1), and `Wire1` to communicate with MKR2 (I2C_2).***
1130+
11271131
To use I2C communication, include the `Wire` library at the top of your sketch. The `Wire` library provides functions for I2C communication:
11281132

11291133
```arduino
@@ -1133,7 +1137,7 @@ In the setup() function, initialize the I2C library:
11331137

11341138
```arduino
11351139
// Initialize the I2C communication
1136-
Wire.begin();
1140+
Wire.begin(); // Wire to use I2C_1 for MKR1
11371141
```
11381142

11391143
To transmit data to an I2C-compatible device, you can use the following commands:
@@ -1178,7 +1182,7 @@ while (Wire.available()) {
11781182
}
11791183
```
11801184

1181-
In the example code below, we are going to communicate the `Edge Control` with a `MKR WiFi 1010`. With a potentiometer connected to the Edge Control, the onboard `LED` of the `MKR board` will be controlled, so we will be sending the brightness value through I2C to it.
1185+
In the example code below, we are going to communicate the `Edge Control` with a `MKR WiFi 1010` connected to MKR1 connector. With a potentiometer connected to the Edge Control, the onboard `LED` of the `MKR board` will be controlled, so we will be sending the brightness value through I2C to it.
11821186

11831187
***Use the same connection from [this section](#analog-inputs) for the potentiometer wiring.***
11841188

@@ -1265,7 +1269,7 @@ void writeBytes(uint8_t *buf, uint8_t len) {
12651269
}
12661270
```
12671271

1268-
#### MKR WiFi Code
1272+
#### MKR WiFi 1010 Code
12691273

12701274
```arduino
12711275
#include <Wire.h>

0 commit comments

Comments
 (0)