Quantcast
Channel: Under Power 研究所
Viewing all articles
Browse latest Browse all 201

ESP32 で2つ目のI2Cを動かすメモ的な何か?

$
0
0
#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()
{
}



M5Stack Gray(9軸IMU搭載)

M5Stack Gray(9軸IMU搭載)

  • 出版社/メーカー: スイッチサイエンス
  • メディア: おもちゃ&ホビー



Viewing all articles
Browse latest Browse all 201

Trending Articles