Created
December 27, 2019 08:11
-
-
Save ksasao/73e551ffd5e1c8e7882cd3561bcab139 to your computer and use it in GitHub Desktop.
実行中のデバイスが M5StickV か UnitV かを調べる
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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