Skip to content

Instantly share code, notes, and snippets.

@ksasao
Created December 27, 2019 08:11
Show Gist options
  • Save ksasao/73e551ffd5e1c8e7882cd3561bcab139 to your computer and use it in GitHub Desktop.
Save ksasao/73e551ffd5e1c8e7882cd3561bcab139 to your computer and use it in GitHub Desktop.
実行中のデバイスが M5StickV か UnitV かを調べる
from machine import I2C
i2c = I2C(I2C.I2C0, freq=100000, scl=28, sda=29)
devices = i2c.scan()
if len(devices)==0:
print("UnitV")
else:
print("StickV")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment