2019-1-31 19:55:31 [显示全部楼层]
4290浏览
查看: 4290|回复: 2

[进阶] 用8x8整体点阵模块和mp3模块来一个安全书包

[复制链接]
其实和我之前做的8x8点阵模块一样,只是增加了MP3模块。做上一个帖子时候还没有那个mp3模块。
其实这个项目可以8x8柔性点阵屏。效果更好。柔性的可以更好的贴合在布料上。
用8x8整体点阵模块和mp3模块来一个安全书包图5
用8x8整体点阵模块和mp3模块来一个安全书包图3
用8x8整体点阵模块和mp3模块来一个安全书包图2
用8x8整体点阵模块和mp3模块来一个安全书包图1
mp3文件的文件名以0x开头,例如01,02.03.后面的字符无所谓。mp3文件拷贝到mp3模块里面。
这个项目用FastLED_master库文件。文件在附件里面有,解压后放在arduion\library目录里面。
用8x8整体点阵模块和mp3模块来一个安全书包图4
[mw_shl_code=applescript,true]/*******Made by Gada888******/
/*******2019-01-29******/

#include <FastLED.h>
#include "Plasma.cpp"
#include "Snake.cpp"
#include "Twinkle.cpp"
#include "DeadChannel.cpp"
#include "Sprite.cpp"

#include <SoftwareSerial.h>
SoftwareSerial Serial1(10, 11);
unsigned char order[4] = {0xAA,0x06,0x00,0xB0};

#define WIDTH 8
#define HEIGHT 8
#define NUM_LEDS WIDTH * HEIGHT

#define DATA_PIN 3

CRGB leds[NUM_LEDS];

void setup() {
  Serial1.begin(9600);
  volume(0x1E);//音量设置0x00-0x1E
  
    FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
}

void loop() {

play(0x01);
delay(5000);

    doTwinkle();
    doSnake();
    //doSprite();
   }

void doDeadChannel() {
    DeadChannel deadChannel(leds, WIDTH, HEIGHT);
    deadChannel.start();
}

void doPlasma() {
    Plasma plasma(leds, WIDTH, HEIGHT);
    plasma.start();
}

void doTwinkle() {
    Twinkle twinkle(leds, WIDTH, HEIGHT, true, true);
    twinkle.start();
}

void doSnake() {
    Snake snake(leds, WIDTH, HEIGHT);
    snake.start();
}
void play(unsigned char Track)
{
unsigned char play[6] = {0xAA,0x07,0x02,0x00,Track,Track+0xB3};//0xB3=0xAA+0x07+0x02+0x00,即最后一位为校验和
Serial1.write(play,6);
}
void volume( unsigned char vol)
{
unsigned char volume[5] = {0xAA,0x13,0x01,vol,vol+0xBE};//0xBE=0xAA+0x13+0x01,即最后一位为校验和
Serial1.write(volume,5);
}
[/mw_shl_code]

Files.rar

128.57 KB, 下载次数: 77

343708950  高级技师

发表于 2019-12-7 19:37:58

请问大佬的电脑系统是什么,为什么我的这个模块插入电脑后没有反应?
回复

使用道具 举报

gada888  版主
 楼主|

发表于 2019-12-9 12:16:28

343708950 发表于 2019-12-7 19:37
请问大佬的电脑系统是什么,为什么我的这个模块插入电脑后没有反应?

用的Windows7系统
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

为本项目制作心愿单
购买心愿单
心愿单 编辑
[[wsData.name]]

硬件清单

  • [[d.name]]
btnicon
我也要做!
点击进入购买页面
上海智位机器人股份有限公司 沪ICP备09038501号-4

© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed

mail