This file contains hidden or 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
| #!/bin/bash | |
| # 設定ファイルをバックアップする。 | |
| # microSDカードのマウント先を指定 | |
| cd /mnt/mmcblk1p1 | |
| mkdir -p backup | |
| cd backup | |
| # 固定IP用の設定ファイル | |
| cp --parents /etc/network/interfaces . |
This file contains hidden or 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
| /* | |
| * SPDX-FileCopyrightText: 2024 M5Stack Technology CO LTD | |
| * SPDX-License-Identifier: MIT | |
| * M5Stack LLM Module で日本語対話。Serial MonitorでBoth BL&CRを設定するとよいです。 | |
| * ksasaoさんのバージョンをAquesTalkで喋るようにしたバージョンです。(https://gist.github.com/ksasao/37425d3463013221e7fd0f9ae5ab1c62) | |
| * | |
| * --- セットアップ --- | |
| * 1.プロジェクトにlibフォルダを作成して、そこにAquesTalkESP32のライブラリを解凍してください。(https://www.a-quest.com/download.html#a-etc) | |
| * 2. VSCode+PlatformIOで、srcフォルダにAquesTalkのExampleにある(AquesTalkTTS_M5.cppとAquesTalkTTS.h)をコピーする必要があります。 | |
| * 3.SDカード上に"/aq_dic/aqdic_m.bin"が必要です。 |
This file contains hidden or 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
| #include <Arduino.h> | |
| #include <M5Dial.h> | |
| #include <Avatar.h> | |
| #include "formatString.hpp" | |
| using namespace m5avatar; | |
| Avatar avatar; | |
| void setup() { |
This file contains hidden or 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
| /* | |
| see also https://stackoverflow.com/questions/7315936/which-of-sprintf-snprintf-is-more-secure/35401865#35401865 | |
| If you leave memory management to std::string, you don't have to free it yourself. | |
| */ | |
| // Using template | |
| #include <string> | |
| template<typename ...Args> std::string formatString(const char* fmt, Args... args) | |
| { | |
| size_t sz = snprintf(nullptr, 0U, fmt, args...); // calculate length |
This file contains hidden or 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
| #include <Arduino.h> | |
| #include <M5Unified.h> | |
| #include <gob_unifiedButton.hpp> | |
| goblib::UnifiedButton unifiedButton; // gob_unifiedButton instance | |
| void setup() { | |
| auto cfg = M5.config(); | |
| M5.begin(cfg); | |
| M5.Display.setTextSize(3); |
This file contains hidden or 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
| #include <Arduino.h> | |
| #include "USB.h" | |
| #include "USBHIDKeyboard.h" | |
| #include "USBHIDMouse.h" | |
| #include <M5Unified.h> | |
| #include <FastLED.h> | |
| USBHIDKeyboard keyboard; | |
| USBHIDMouse mouse; | |
| void setup() { |
This file contains hidden or 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)途中でモードを変える場合 |
This file contains hidden or 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
| // Example sketch which shows how to display some patterns | |
| // on a 64x32 LED matrix | |
| // Copyright(c) 2024 Takao Akaki | |
| #include <M5Unified.h> | |
| #include <ESP32-HUB75-MatrixPanel-I2S-DMA.h> | |
| // Change these to whatever suits | |
| #define R1_PIN 1 | |
| #define G1_PIN 2 |
This file contains hidden or 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
| { | |
| "build": { | |
| "core": "esp32", | |
| "f_cpu": "160000000L", | |
| "f_flash": "80000000L", | |
| "flash_mode": "qio", | |
| "mcu": "esp32c6", | |
| "variant": "esp32c6" | |
| }, | |
| "connectivity": [ |
This file contains hidden or 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
| /* | |
| M5Unified(M5GFX)でSPI接続の外部LCD(外部液晶)を使用するサンプル。 | |
| M5StampS3に下記のように接続しています。0.85インチ LCDディスプレイモジュール(128x128、SPI接続) | |
| M5StampS3 --- LCD | |
| 3V3 - VCC | |
| GND - GND | |
| 1 - DIN(MOSI) | |
| 2 - CLK(SCLK) | |
| 3 - CS | |
| 4 - DC |