You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/03.nano/boards/nano-esp32/tutorials/cheat-sheet/cheat-sheet.md
+37-1Lines changed: 37 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -253,7 +253,7 @@ analogWrite(pin,value);
253
253
254
254

255
255
256
-
The default pins used for I2C on the Nano ESP32 are the following:
256
+
The default pins used for the **main I2C bus** on the Nano ESP32 are the following:
257
257
258
258
| Pin | Function | Description |
259
259
| --- | -------- | -------------------- |
@@ -281,6 +281,19 @@ Wire.write(val); //send a value
281
281
Wire.endTransmission(); //stop transmit
282
282
```
283
283
284
+
### Second I2C Bus
285
+
286
+
The Nano ESP32 has a second I2C bus, accessed via `Wire1`. To use it, you will need to set two free pins for SDA & SCL.
287
+
288
+
For example:
289
+
290
+
```arduino
291
+
//initializes second I2C bus on pins D4,D5
292
+
Wire1.begin(D4, D5); //sda, scl
293
+
```
294
+
295
+
***`Wire` and `Wire1` can be used simultaneously, a great feature when working with devices that may share the same addresses.***
296
+
284
297
## SPI
285
298
286
299

@@ -320,6 +333,29 @@ void loop() {
320
333
}
321
334
```
322
335
336
+
### Second SPI Port (HSPI)
337
+
338
+
The Nano ESP32 has a second SPI port (HSPI). To use it, we need to create an object using `SPIClass`, and initialize communication on a specific set of pins.
339
+
340
+
***The HSPI port's default pins are: `GPIO14` (SCK), `GPIO12` (CIPO), `GPIO13` (COPI), `GPIO15` (CS). As some of these pins are not accessible on the Nano ESP32, you will need to configure them manually. See the definitions at the top of the code example below.***
0 commit comments