Japanese | English
This is a simple implementation that adds Bluetooth speaker functionality and Stack-chan's servo control features based on M5Stack-Avatar. It is modified from the Bluetooth_with_ESP32A2DP example in M5Unified.
- VSCode
- PlatformIO
-
M5Stack Basic/Gray/M5Go
For Basic, only models with 16MB Flash memory are supported. -
M5Stack Fire
-
M5Stack Core2 / Core2 for AWSIoT
Arduino-ESP32 has been tested with version 2.0.4 (2.0.0 for Fire only). M5Stack Fire has issues with arduino-esp32v2.0.4 and won't start.
For detailed version information, please check platformio.ini.
-
M5Stack Fire V2.6/M5Stack Basic V2.6
When using TF card, we found that SD.begin() cannot read at speeds above 20MHz. We have lowered it to 15MHz. -
M5Stack Basic V2.6
When compiling with VSCode+PlatformIO, selectenv:m5stack-greyas the env.
If there is no YAML configuration file on the SD card, default values will be used. (Set to connect servo to PortA.)
Place /yaml/SC_BasicConfig.yaml on the SD card to use your own settings.
On 2022/10/18, we changed from JSON to YAML. You can convert from JSON to YAML using JSON to YAML Converter.
Please note that comment handling has changed.
On 2025/03/24, we changed to use the stackchan-arduino library. Please create SC_BasicConfig.yaml based on the contents of SC_Config.yaml.
For details, please refer to the YAML file.
(Values in parentheses are default values)
-
servo
- pin
- x(Core1 22, Core2 33, CoreS3 1)
Specify GPIO for X-axis (RX for serial servo) - y(Core1 21, Core2 32, CoreS3 2)
Specify GPIO for Y-axis (TX for serial servo)
- x(Core1 22, Core2 33, CoreS3 1)
- offset
Parameter to correct misalignment when servo axis is at 90°- x(0)
Set X-axis offset value - y(0)
Set Y-axis offset value
- x(0)
- center
Specify servo center position- x(180)
X-axis center position - y(270)
Y-axis center position
- x(180)
- lower_limit
Specify servo lower limit- x(0)
X-axis lower limit - y(240)
Y-axis lower limit
- x(0)
- upper_limit
Specify servo upper limit- x(360)
X-axis upper limit - y(280)
Y-axis upper limit
- x(360)
- speed
Specify waiting time and servo movement time during standby and when sound is playing through Bluetooth speaker. Random values are used within the range specified by minimum and maximum values.- normal_mode
- interval_min(3000)
- interval_max(6000)
- move_min(500)
- move_max(1500)
- sing_mode
- interval_min(500)
- interval_max(1000)
- move_min(500)
- move_max(1000)
- normal_mode
- pin
-
bluetooth
- device_name(M5Stack)
Specify the Bluetooth speaker device name. - starting_state(false)
Specify whether to start in Bluetooth mode. - start_volume(100)
Set initial value for Bluetooth speaker
- device_name(M5Stack)
-
auto_power_off_time(0)
Core2 only. Powers off after the specified time has elapsed after USB power supply is turned OFF. (0 means no power off) -
balloon
Configure speech bubble settings.- font_language("CN")
Specify font language. "JA" or "CN", uses Latin font if not specified. - lyrics
Set lines to display randomly in normal mode. Maximum of 10 lines.
- font_language("CN")
-
led_lr(0)
LED lights according to volume in GoBottom1/2. *Requires source code modification and recompilation.- 0: Stereo
- 1: Responds to left volume only
- 2: Responds to right volume only
-
led_pin(15)
Specify GPIO pin number for LED (GoBottom1: 15, GoBottom2: 25) -
takao_base(false)
Setting for using Stack-chan_Takao_Base. (*Currently only supported on Core2) -
servo_type("DYN_XL330")
Specify servo type- "PWM": SG90 series PWM servo
- "SCS": Feetech SCS0009 serial servo
- "DYN_XL330": Dynamixel XL330 serial servo
-
extend_config_filename("")
Configuration filename for application -
extend_config_filesize(2048)
Buffer size for feature extensions -
secret_config_filename("")
Configuration filename for personal information -
secret_config_filesize(2048)
Buffer size for personal information -
secret_info_show(true)
Whether to output personal information to log
-
BtnA
Enter Bluetooth mode. (Only valid when bluetooth_mode = false) -
BtnB
Decrease volume. -
BtnC
Increase volume.