Skip to content

6. Extra Libraries

Ioannis Charalampidis edited this page Jan 16, 2019 · 3 revisions

6.1. Software I²C on GPIO Expansion

Since the native I²C pins on the ESP8266 module is use for other purposes, the only way you could use an I²C peripheral is to use Soft-I²C over the GPIO expansion chip.

To mitigate this issue, the uNode library comes with a built-in override to the Wire.h header, that uses the software implementation capable to operate both on native and extended pins.

Usage

To use the custom Wire.h library you should include it before including other libraries that depend on it. For example:

#include <uNode.hpp>
#include <Wire.h> // This will be sourced from the uNode library

void setup() {
   uNode.setup();
   Wire.begin(
     D2, // SDA Pin
     D3  // SCL pin
   );
   ...
}
Clone this wiki locally