0
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?

M5Atom S3のGROVE端子でI2C

Last updated at Posted at 2025-07-18

M5AtomS3 では、

Wire.begin();
 :

で開始すると内部の加速度センサー(0x68)しか見つからないので、
GROVE端子に接続されたI2Cデバイスを検出するには

Wire.begin(G2,G1); // GROVE SDA, SCL
 :

のようにする必要があります。

PlatformIOで行う場合は、

platform.ini
[platformio]
default_envs = m5stack-stamps3

[env:m5stack-stamps3]
platform = espressif32
board = m5stack-stamps3
framework = arduino
build_flags = -D INI_ATOMS3
monitor_speed = 115200
 :

INI_ATOMS3を定義した後、

main.ino
#ifdef INI_ATOMS3
    Wire.begin(G2,G1); // GROBE SDA, SCL
#else
    Wire.begin();
#endif

のようにしておくと他のボードと共通のソースを使用できるので便利です。

関連

0
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
0
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?