Skip to content

Commit 4b704cb

Browse files
authored
Merge pull request #3 from mongonta0716/SCSEasing
Fix examples/Basic
2 parents 8bd5bee + 194c8e1 commit 4b704cb

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

examples/Basic/src/main.cpp

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@
22
#include <M5Unified.h>
33
#include <SD.h>
44
#include "Stackchan_ex_config.h"
5+
#include <Stackchan_servo.h>
6+
#include <Avatar.h>
57

6-
StackchanExConfig config;
8+
using namespace m5avatar;
9+
10+
Avatar avatar;
11+
12+
StackchanSERVO servo;
13+
StackchanExConfig system_config;
714

815
void setup() {
916
auto cfg = M5.config();
@@ -12,7 +19,23 @@ void setup() {
1219
M5.Log.setEnableColor(m5::log_target_serial, false);
1320
SD.begin(GPIO_NUM_4, SPI, 25000000);
1421
delay(2000);
15-
config.loadConfig(SD, "/yaml/SC_BasicConfig.yaml");
22+
system_config.loadConfig(SD, "/yaml/SC_BasicConfig.yaml");
23+
24+
// servo
25+
servo.begin(system_config.getServoInfo(AXIS_X)->pin, system_config.getServoInfo(AXIS_X)->start_degree,
26+
system_config.getServoInfo(AXIS_X)->offset,
27+
system_config.getServoInfo(AXIS_Y)->pin, system_config.getServoInfo(AXIS_Y)->start_degree,
28+
system_config.getServoInfo(AXIS_Y)->offset,
29+
(ServoType)system_config.getServoType());
30+
delay(2000);
31+
avatar.init();
32+
33+
servo_interval_s* servo_interval = system_config.getServoInterval(AvatarMode::NORMAL); // ノーマルモード時のサーボインターバル情報を取得
34+
servo_interval_s* servo_interval_sing = system_config.getServoInterval(AvatarMode::SINGING); // 歌っているときのサーボインターバル情報を取得
35+
36+
// wifi
37+
wifi_s* wifi_info = system_config.getWiFiSetting();
38+
api_keys_s* api_key = system_config.getAPISetting();
1639

1740
}
1841

0 commit comments

Comments
 (0)