Created
April 17, 2024 23:49
-
-
Save mongonta0716/5bf5e4ed9e6d87961df54753f8239d8f to your computer and use it in GitHub Desktop.
M5Stack Core2, CoreS3でStackchan-Takao_Baseを利用する際のコード例
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
// Stack-chan_Takao_Baseを使用する場合、のコード例 | |
// ※ この設定を行うと、M5Stack本体のUSB-Cに接続してもバッテリーは充電されなくなります。 | |
// (1)初期設定で設定するやり方 | |
auto cfg = M5.config(); | |
cfg.output_power = false; // Groveポートの5VをINに設定します。この設定で背面のUSB-C端子に接続するとM5Stackの電源とバッテリーの充電ができます。 | |
M5.begin(cfg); // 設定を有効にします。 | |
// (2)途中でモードを変える場合 | |
M5.Power.setExtOutput(false); // 初期値はtrue | |
//--------------------戻す場合---------------------- | |
M5.Power.setExtOutput(true); // これでUSB-Cの横から充電できるようになります。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment