ArduinoファームのESP-WROOM-02(ESP8266)開発ボードでI2C通信

IMG_9972
ESP-WROOM-02開発ボードをArduinoファームにして遊んでいるのですが、Wireライブラリ(I2C)に使うピンが分からなかったのでメモ

  • SCL – IO5
  • SDA – IO4

I2C通信テスト


I2C通信のテスト。上記のVine動画で点灯しているのは、PCA9622DR搭載したLEDモジュールArduino用のソースコードままで動きました。

追記

Arduino ESP8266のピン配列

Wire library currently supports master mode up to approximately 450KHz. Before using I2C, pins for SDA and SCL need to be set by calling Wire.begin(int sda, int scl), i.e. Wire.begin(0, 2) on ESP-01, else they default to pins 4(SDA) and 5(SCL).

I2Cのピン設定は、変えられるそうです。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です