#include <Wire.h> #define I2C_HERTZ (100 * 1000) #define SDA_PIN 25 #define SCL_PIN 26 #define I2C1_HERTZ (100 * 1000) #define SDA1_PIN 17 #define SCL1_PIN 16 TwoWire i2c1( 1 ); void setup() { Wire.begin( SDA_PIN, SCL_PIN ); // Wire.begin( SDA, SCL ); Wire.setClock( I2C_HERTZ ); // default = 100kbps i2c1.begin( SDA1_PIN, SCL1_PIN ); i2c1.setClock( I2C1_HERTZ ); // default = 100kbps } void loop() { }
↧
ESP32 で2つ目のI2Cを動かすメモ的な何か?
↧