Skip to content

Commit

Permalink
12.17
Browse files Browse the repository at this point in the history
  • Loading branch information
WTFkiro committed Dec 17, 2021
1 parent 5a525f9 commit 430da96
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 21 deletions.
6 changes: 0 additions & 6 deletions ESP32/Demons/Main_Deal.ino
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
int DEAL()
{
henshin_state = 1;
if (NowAnimal == 3)
{
button_state = 0;
playmusic(6, 8);
return 0;
}
playmusic(1, 0x01);
Demons_Deal();
button_state = 0; //按键信号复位
Expand Down
28 changes: 13 additions & 15 deletions ESP32/Demons/Main_Mp3.ino
Original file line number Diff line number Diff line change
Expand Up @@ -44,40 +44,39 @@ LI: 6
05 line2
06 fight
07 out
08 failed
*/

void playmusic(int folder, unsigned char Track)
{
//播放选中目录下的曲目,0x01是第一首
if (folder == 1) //KA
{
unsigned char PLAY[16] = {0xAA, 0x08, 0x0C, 0x01, 0x2F, 0x4B, 0x41, 0x2A, 0x2F, 0x30, Track + 0x30, 0x2A, 0x3F, 0x3F, 0x3F, 0x1A + Track};
unsigned char PLAY[16] = {0xAA, 0x08, 0x0C, 0x02, 0x2F, 0x4B, 0x41, 0x2A, 0x2F, 0x30, Track + 0x30, 0x2A, 0x3F, 0x3F, 0x3F, 0x1B + Track};
MySerial.write(PLAY, 16);
}
else if (folder == 2) //LO
{
unsigned char PLAY[16] = {0xAA, 0x08, 0x0C, 0x01, 0x2F, 0x4C, 0x4F, 0x2A, 0x2F, 0x30, Track + 0x30, 0x2A, 0x3F, 0x3F, 0x3F, Track + 0x29};
unsigned char PLAY[16] = {0xAA, 0x08, 0x0C, 0x02, 0x2F, 0x4C, 0x4F, 0x2A, 0x2F, 0x30, Track + 0x30, 0x2A, 0x3F, 0x3F, 0x3F, Track + 0x2A};
MySerial.write(PLAY, 16);
}
else if (folder == 3) //S
{
unsigned char PLAY[15] = {0xAA, 0x08, 0x0B, 0x01, 0x2F, 0x53, 0x2A, 0x2F, 0x30, Track + 0x30, 0x2A, 0x3F, 0x3F, 0x3F, 0xE0 + Track};
unsigned char PLAY[15] = {0xAA, 0x08, 0x0B, 0x02, 0x2F, 0x53, 0x2A, 0x2F, 0x30, Track + 0x30, 0x2A, 0x3F, 0x3F, 0x3F, 0xE1 + Track};
MySerial.write(PLAY, 15);
}
else if (folder == 4) //B
{
unsigned char PLAY[15] = {0xAA, 0x08, 0x0B, 0x01, 0x2F, 0x42, 0x2A, 0x2F, 0x30, Track + 0x30, 0x2A, 0x3F, 0x3F, 0x3F, 0xCF + Track};
unsigned char PLAY[15] = {0xAA, 0x08, 0x0B, 0x02, 0x2F, 0x42, 0x2A, 0x2F, 0x30, Track + 0x30, 0x2A, 0x3F, 0x3F, 0x3F, 0xD0 + Track};
MySerial.write(PLAY, 15);
}
else if (folder == 5) //PU
{
unsigned char PLAY[16] = {0xAA, 0x08, 0x0C, 0x01, 0x2F, 0x50, 0x55, 0x2A, 0x2F, 0x30, Track + 0x30, 0x2A, 0x3F, 0x3F, 0x3F, 0x33 + Track};
unsigned char PLAY[16] = {0xAA, 0x08, 0x0C, 0x02, 0x2F, 0x50, 0x55, 0x2A, 0x2F, 0x30, Track + 0x30, 0x2A, 0x3F, 0x3F, 0x3F, 0x34 + Track};
MySerial.write(PLAY, 16);
}
else if (folder == 6) //LI
{
unsigned char PLAY[16] = {0xAA, 0x17, 0x0C, 0x01, 0x2F, 0x4C, 0x49, 0x2A, 0x2F, 0x30, Track + 0x30, 0x2A, 0x3F, 0x3F, 0x3F, 0x32 + Track};
unsigned char PLAY[16] = {0xAA, 0x17, 0x0C, 0x02, 0x2F, 0x4C, 0x49, 0x2A, 0x2F, 0x30, Track + 0x30, 0x2A, 0x3F, 0x3F, 0x3F, 0x33 + Track};
MySerial.write(PLAY, 16);
}
}
Expand All @@ -89,36 +88,35 @@ void playmode(unsigned char mode)
MySerial.write(Mode, 5);
}

void looptime(unsigned char loop) //设置循环次数
void looptime(unsigned char loop)
{
unsigned char Mode[5] = {0xAA, 0x19, 0x02, loop, loop + 0xC3};
MySerial.write(Mode, 5);
}

void volume(unsigned char vol) //初始化音量
void volume(unsigned char vol)
{
unsigned char volume[5] = {0xAA, 0x13, 0x01, vol, vol + 0xBE}; //0xBE=0xAA+0x13+0x01,即最后一位为校验和
MySerial.write(volume, 5);
}

void volume_add() //增加音量
void volume_add()
{
unsigned char addvolume[4] = {0xAA, 0x14, 0x00, 0xBE};
MySerial.write(addvolume, 4);
}

void volume_decrease() //减小音量
void volume_decrease()
{
unsigned char decrease[4] = {0xAA, 0x15, 0x00, 0xBF};
MySerial.write(decrease, 4);
}

void insertmusic(int nowanimal) //切换印章时播放印章按动音效
void insertmusic(int nowanimal)
{
unsigned char cut[16] = {0xAA, 0x17, 0x0C, 0x01, 0x2F, 0x50, 0x55, 0x2A, 0x2F, 0x30, 0x30 + nowanimal, 0x2A, 0x3F, 0x3F, 0x3F, 0x42 + nowanimal};
unsigned char cut[16] = {0xAA, 0x17, 0x0C, 0x02, 0x2F, 0x50, 0x55, 0x2A, 0x2F, 0x30, 0x30 + nowanimal, 0x2A, 0x3F, 0x3F, 0x3F, 0x43 + nowanimal};
MySerial.write(cut, 16);
}

void playsong() //从mu目录开始播放歌曲
{
unsigned char song[14] = {0xAA, 0x08, 0x0A, 0x01, 0x2F, 0x4D, 0x55, 0x2A, 0x2F, 0x2A, 0x3F, 0x3F, 0x3F, 0xCE};
Expand Down Expand Up @@ -171,12 +169,12 @@ void playline() //播放台词,并根据变身状态播放对应台词
else
{
playmusic(6, linecount);
linecount++;
}
if (linecount >= 5)
{
linecount = 0;
}
linecount++;
}

void VolumeSet() //通过旋钮来调节音量
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ release1.0版本以后,将使用Wemos D1 R32开发
转载,发布等请注明GitHub项目源地址
仅供学习交流,请勿用作商业使用

## 12.17日更新

所有面板都已经拼装完成,预期的功能也全部都实现
接下来将开始mini版本的开发

### Demons Driver mini 前瞻

1. 采用D1 mini ESP8266开发板 + 更小的WS2812点阵模块,并且设计专用PCB板与模块连接,体积减小50%以上

2. 采用JQ8900-TF模块,内存更大,可以存放更多歌曲等,实现mp3播放器功能

3. 视可能会加入BT,WIFI模块功能

至此封装demons driver 1.3 release版本。当前项目告一段落

## 12.13日更新

1. 新增数条台词语音,门田的话更多了
Expand Down

0 comments on commit 430da96

Please sign in to comment.