1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

M5Stack EXT.IOであそぶ(理系フリマ入手)

Last updated at Posted at 2024-08-31

参考

目的
I2C エックステンダーの8ビットポートICを使って遊ぶ
中身は、PCA9554

o_coq352.jpg

o_coq353.jpg

o_coq354.jpg

結果

o_coq355.jpg

プログラム




//PCA9554_S3_1


//インクルド(SSD1306用)
#include <Arduino.h>
#include <Wire.h>


//初期化
void setup() {

  //I2Cの初期化
  Wire.begin(); //S3
  delay(200);

  Wire.beginTransmission(  0x27  ); //アドレス

  Wire.write(0x03); //コマンド

  Wire.write(0x00); //データ

  Wire.endTransmission();

  delay(200); //0.2秒待つ



  
}//setup


//メインループ
void loop() {


  Wire.beginTransmission(  0x27  ); //アドレス

  Wire.write(0x01); //コマンド

  Wire.write(0xFF); //データ

  Wire.endTransmission();

  delay(1000); //1秒待つ


  Wire.beginTransmission(  0x27  ); //アドレス

  Wire.write(0x01); //コマンド

  Wire.write(0x00); //データ

  Wire.endTransmission();

  delay(1000); //1秒待つ

}//loop



1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?