File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change 2
2
#include < M5Unified.h>
3
3
#include < SD.h>
4
4
#include " Stackchan_ex_config.h"
5
+ #include < Stackchan_servo.h>
6
+ #include < Avatar.h>
5
7
6
- StackchanExConfig config;
8
+ using namespace m5avatar ;
9
+
10
+ Avatar avatar;
11
+
12
+ StackchanSERVO servo;
13
+ StackchanExConfig system_config;
7
14
8
15
void setup () {
9
16
auto cfg = M5.config ();
@@ -12,7 +19,23 @@ void setup() {
12
19
M5.Log .setEnableColor (m5::log_target_serial, false );
13
20
SD.begin (GPIO_NUM_4, SPI, 25000000 );
14
21
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 ();
16
39
17
40
}
18
41
You can’t perform that action at this time.
0 commit comments