2408|32

3386

帖子

0

TA的资源

五彩晶圆(中级)

楼主
 

【花雕动手做】有趣好玩的音乐可视化系列项目(28)--LED乒乓球灯 [复制链接]

 

偶然心血来潮,想要做一个音乐可视化的系列专题。这个专题的难度有点高,涉及面也比较广泛,相关的FFT和FHT等算法也相当复杂,不过还是打算从最简单的开始,实际动手做做试验,耐心尝试一下各种方案,逐步积累些有用的音乐频谱可视化的资料,也会争取成型一些实用好玩的音乐可视器项目。

 

在TB上收了100只乒乓球,加上赠送2只,一共102只,可选的排列方式有二种,一种是10X10平面排列,还有一种是圆柱体螺旋排列,目前准备试下后一个方案。

 

查看本帖全部内容,请登录或者注册

最新回复

乒乓球感觉不如玻璃球晶莹剔透 大佬哪天弄个棱镜玩玩啊 那个才是五光十色  详情 回复 发表于 2022-10-16 18:34
点赞 关注
 

回复
举报

2万

帖子

74

TA的资源

管理员

沙发
 

期待:)

加EE小助手好友,
入技术交流群
EE服务号
精彩活动e手掌握
EE订阅号
热门资讯e网打尽
聚焦汽车电子软硬件开发
认真关注技术本身

点评

谢谢鼓励  详情 回复 发表于 2022-10-12 15:53
个人签名

加油!在电子行业默默贡献自己的力量!:)

 
 

回复

3386

帖子

0

TA的资源

五彩晶圆(中级)

板凳
 

谢谢鼓励

 
 
 

回复

3386

帖子

0

TA的资源

五彩晶圆(中级)

4
 

找到一段PV水管

 

 

 
 
 

回复

3386

帖子

0

TA的资源

五彩晶圆(中级)

5
 

直接11厘米,长度39厘米,准备做为乒乓球灯的主体结构

 

 

 
 
 

回复

3386

帖子

0

TA的资源

五彩晶圆(中级)

6
 

以前的一个蚊香盘子,来当底座

 

 

 
 
 

回复

3386

帖子

0

TA的资源

五彩晶圆(中级)

7
 

灯带采用每米30灯白底裸板

 

 
 
 

回复

3386

帖子

0

TA的资源

五彩晶圆(中级)

8
 

WS2812B

是一个集控制电路与发光电路于一体的智能外控LED光源。其外型与一个5050LED灯珠相同,每个元件即为一个像素点。像素点内部包含了智能数字接口数据锁存信号整形放大驱动电路,还包含有高精度的内部振荡器和12V高压可编程定电流控制部分,有效保证了像素点光的颜色高度一致。数据协议采用单线归零码的通讯方式,像素点在上电复位以后,DIN端接受从控制器传输过来的数据,首先送过来的24bit数据被第一个像素点提取后,送到像素点内部的数据锁存器,剩余的数据经过内部整形处理电路整形放大后通过DO端口开始转发输出给下一个级联的像素点,每经过一个像素点的传输,信号减少24bit。像素点采用自动整形转发技术,使得该像素点的级联个数不受信号传送的限制,仅仅受限信号传输速度要求。

 

 
 
 

回复

3386

帖子

0

TA的资源

五彩晶圆(中级)

9
 

主要特点
1、智能反接保护,电源反接不会损坏IC。
2、IC控制电路与LED点光源公用一个电源。
3、控制电路与RGB芯片集成在一个5050封装的元器件中,构成一个完整的外控像素点。
4、内置信号整形电路,任何一个像素点收到信号后经过波形整形再输出,保证线路波形畸变不会累加。
5、内置上电复位和掉电复位电路。
6、每个像素点的三基色颜色可实现256级亮度显示,完成16777216种颜色的全真色彩显示,扫描频率不低于400Hz/s。
7、串行级联接口,能通过一根信号线完成数据的接收与解码。
8、任意两点传传输距离在不超过5米时无需增加任何电路。
9、当刷新速率30帧/秒时,级联数不小于1024点。
10、数据发送速度可达800Kbps。
11、光的颜色高度一致,性价比高。

应用领域
具有低电压驱动,环保节能,亮度高,散射角度大,一致性好,超低功率,超长寿命等优点。将控制电路集成于LED上面,电路变得更加简单,体积小,安装更加简便。主要应用领域,LED全彩发光字灯串,LED全彩模组, LED全彩软灯条硬灯条,LED护栏管。LED点光源,LED像素屏,LED异形屏,各种电子产品,电器设备跑马灯等。

 

 
 
 

回复

3386

帖子

0

TA的资源

五彩晶圆(中级)

10
 

WS2812B灯带电原理图

 

 
 
 

回复

3386

帖子

0

TA的资源

五彩晶圆(中级)

11
 

WS2812B是集控制电路和发光电路于一体的LED光源元件,其控制IC为WS2812B,发光元件是5050RGBLED,电压为5V,每个单位的峰值电流为60ma,灯带为三线制,VCC GND DIN分别为电源+、电源-、信号,当使用外部电源时,外部电源-需要与单片机的GND相连。

 

 

 
 
 

回复

3386

帖子

0

TA的资源

五彩晶圆(中级)

12
 

开始安装乒乓球.......

 

 
 
 

回复

3386

帖子

0

TA的资源

五彩晶圆(中级)

13
 

总共用了101 个乒乓球

 

 
 
 

回复

3386

帖子

0

TA的资源

五彩晶圆(中级)

14
 

  【花雕动手做】有趣好玩的音乐可视化系列项目(28)--LED乒乓球灯

  项目程序之一:绿色单灯循环测试

  模块接线:WS2812B接D6

  MAX4466      UNO

  VCC          5V

  GND         GND

  OUT          D6

 

  • /*
  • 【花雕动手做】有趣好玩的音乐可视化系列项目(28)--LED乒乓球灯
  • 项目程序之一:绿色单灯循环测试
  • 模块接线:WS2812B接D6
  • MAX4466 UNO
  • VCC 5V
  • GND GND
  • OUT D6
  • */
  • #include <Adafruit_NeoPixel.h>
  • #define PIN 6
  • #define MAX_LED 101
  • #define ADD true
  • #define SUB false
  • int val = 0;
  • boolean stat = ADD;
  • Adafruit_NeoPixel strip = Adafruit_NeoPixel( MAX_LED, PIN, NEO_RGB + NEO_KHZ800 );
  • void setup() {
  • strip.begin();
  • strip.show();
  • }
  • void loop() {
  • uint8_t i, a = 0;
  • uint32_t color = strip.Color(255, 100, 0);
  • while (a < 102)
  • {
  • for (i = 0; i < 101; i++)
  • {
  • if (i == a) strip.setPixelColor(i, color);
  • else strip.setPixelColor(i, 0);
  • }
  • strip.show();
  • delay(20);
  • a++;
  • }
  • }

 

 
 
 

回复

3386

帖子

0

TA的资源

五彩晶圆(中级)

15
 

实验场景图

 

 

 
 
 

回复

3386

帖子

0

TA的资源

五彩晶圆(中级)

16
 

实验场景图  动态图

 

 

点击上图查看Gif动图

 
 
 

回复

3386

帖子

0

TA的资源

五彩晶圆(中级)

17
 

  【花雕动手做】有趣好玩的音乐可视化系列项目(28)--LED乒乓球灯

  项目程序之二:NeoPixel 环形灯测试程序

  模块接线:WS2812B接D6

  MAX4466      UNO

  VCC          5V

  GND         GND

  OUT          A0

 

  • /*
  • 【花雕动手做】有趣好玩的音乐可视化系列项目(28)--LED乒乓球灯
  • 项目程序之二:NeoPixel 环形灯测试程序
  • 模块接线:WS2812B接D6
  • MAX4466 UNO
  • VCC 5V
  • GND GND
  • OUT A0
  • */
  • #include <Adafruit_NeoPixel.h>
  • #ifdef __AVR__
  • #include <avr/power.h> // Required for 16 MHz Adafruit Trinket
  • #endif
  • // Which pin on the Arduino is connected to the NeoPixels?
  • // On a Trinket or Gemma we suggest changing this to 1:
  • #define LED_PIN 6
  • // How many NeoPixels are attached to the Arduino?
  • #define LED_COUNT 101
  • // Declare our NeoPixel strip object:
  • Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
  • // Argument 1 = Number of pixels in NeoPixel strip
  • // Argument 2 = Arduino pin number (most are valid)
  • // Argument 3 = Pixel type flags, add together as needed:
  • // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
  • // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
  • // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
  • // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
  • // NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)
  • // setup() function -- runs once at startup --------------------------------
  • void setup() {
  • // These lines are specifically to support the Adafruit Trinket 5V 16 MHz.
  • // Any other board, you can remove this part (but no harm leaving it):
  • #if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
  • clock_prescale_set(clock_div_1);
  • #endif
  • // END of Trinket-specific code.
  • strip.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
  • strip.show(); // Turn OFF all pixels ASAP
  • strip.setBrightness(150); // Set BRIGHTNESS to about 1/5 (max = 255)
  • }
  • // loop() function -- runs repeatedly as long as board is on ---------------
  • void loop() {
  • // Fill along the length of the strip in various colors...
  • colorWipe(strip.Color(255, 0, 0), 250); // Red
  • colorWipe(strip.Color( 0, 255, 0), 250); // Green
  • colorWipe(strip.Color( 0, 0, 255), 250); // Blue
  • // Do a theater marquee effect in various colors...
  • theaterChase(strip.Color(127, 127, 127), 250); // White, half brightness
  • theaterChase(strip.Color(127, 0, 0), 250); // Red, half brightness
  • theaterChase(strip.Color( 0, 0, 127), 250); // Blue, half brightness
  • rainbow(10); // Flowing rainbow cycle along the whole strip
  • theaterChaseRainbow(50); // Rainbow-enhanced theaterChase variant
  • }
  • // Some functions of our own for creating animated effects -----------------
  • // Fill strip pixels one after another with a color. Strip is NOT cleared
  • // first; anything there will be covered pixel by pixel. Pass in color
  • // (as a single 'packed' 32-bit value, which you can get by calling
  • // strip.Color(red, green, blue) as shown in the loop() function above),
  • // and a delay time (in milliseconds) between pixels.
  • void colorWipe(uint32_t color, int wait) {
  • for (int i = 0; i < strip.numPixels(); i++) { // For each pixel in strip...
  • strip.setPixelColor(i, color); // Set pixel's color (in RAM)
  • strip.show(); // Update strip to match
  • delay(30); // Pause for a moment
  • }
  • }
  • // Theater-marquee-style chasing lights. Pass in a color (32-bit value,
  • // a la strip.Color(r,g,b) as mentioned above), and a delay time (in ms)
  • // between frames.
  • void theaterChase(uint32_t color, int wait) {
  • for (int a = 0; a < 20; a++) { // Repeat 10 times...
  • for (int b = 0; b < 3; b++) { // 'b' counts from 0 to 2...
  • strip.clear(); // Set all pixels in RAM to 0 (off)
  • // 'c' counts up from 'b' to end of strip in steps of 3...
  • for (int c = b; c < strip.numPixels(); c += 3) {
  • strip.setPixelColor(c, color); // Set pixel 'c' to value 'color'
  • }
  • strip.show(); // Update strip with new contents
  • delay(30); // Pause for a moment
  • }
  • }
  • }
  • // Rainbow cycle along whole strip. Pass delay time (in ms) between frames.
  • void rainbow(int wait) {
  • // Hue of first pixel runs 5 complete loops through the color wheel.
  • // Color wheel has a range of 65536 but it's OK if we roll over, so
  • // just count from 0 to 5*65536. Adding 256 to firstPixelHue each time
  • // means we'll make 5*65536/256 = 1280 passes through this outer loop:
  • for (long firstPixelHue = 0; firstPixelHue < 2 * 65536; firstPixelHue += 256) {
  • for (int i = 0; i < strip.numPixels(); i++) { // For each pixel in strip...
  • // Offset pixel hue by an amount to make one full revolution of the
  • // color wheel (range of 65536) along the length of the strip
  • // (strip.numPixels() steps):
  • int pixelHue = firstPixelHue + (i * 65536L / strip.numPixels());
  • // strip.ColorHSV() can take 1 or 3 arguments: a hue (0 to 65535) or
  • // optionally add saturation and value (brightness) (each 0 to 255).
  • // Here we're using just the single-argument hue variant. The result
  • // is passed through strip.gamma32() to provide 'truer' colors
  • // before assigning to each pixel:
  • strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(pixelHue)));
  • }
  • strip.show(); // Update strip with new contents
  • delay(2); // Pause for a moment
  • }
  • }
  • // Rainbow-enhanced theater marquee. Pass delay time (in ms) between frames.
  • void theaterChaseRainbow(int wait) {
  • int firstPixelHue = 0; // First pixel starts at red (hue 0)
  • for (int a = 0; a < 30; a++) { // Repeat 30 times...
  • for (int b = 0; b < 3; b++) { // 'b' counts from 0 to 2...
  • strip.clear(); // Set all pixels in RAM to 0 (off)
  • // 'c' counts up from 'b' to end of strip in increments of 3...
  • for (int c = b; c < strip.numPixels(); c += 3) {
  • // hue of pixel 'c' is offset by an amount to make one full
  • // revolution of the color wheel (range 65536) along the length
  • // of the strip (strip.numPixels() steps):
  • int hue = firstPixelHue + c * 65536L / strip.numPixels();
  • uint32_t color = strip.gamma32(strip.ColorHSV(hue)); // hue -> RGB
  • strip.setPixelColor(c, color); // Set pixel 'c' to value 'color'
  • }
  • strip.show(); // Update strip with new contents
  • delay(50); // Pause for a moment
  • firstPixelHue += 65536 / 90; // One cycle of color wheel over 90 frames
  • }
  • }
  • }

 

 
 
 

回复

3386

帖子

0

TA的资源

五彩晶圆(中级)

18
 

实验场景图

 

 

 
 
 

回复

3386

帖子

0

TA的资源

五彩晶圆(中级)

19
 
本帖最后由 eagler8 于 2022-10-14 16:44 编辑

实验的视频记录

优酷:https://v.youku.com/v_show/id_XNTkxMTY4OTUxNg==.html?spm=a2hcb.playlsit.page.3

B站:https://www.bilibili.com/video/BV1km4y1A7Tn/?vd_source=98c6b1fc23b2787403d97f8d3cc0b7e5

 


 

 
 
 

回复

3386

帖子

0

TA的资源

五彩晶圆(中级)

20
 

声音模块,使用性价比更高的MAX4466声音传感器。

MAX4466模块特点
电源电压:+2.4V至+5.5V(可直接接STM/ARDUNIO/树莓派等开发板)
电源抑制比:112dB
共模抑制比:126dB
AVOL:125dB(RL = 100kΩ) 轨到轨输出
静态电源电流:24μA
增益带宽:600kHz
尺寸:20.8mm x 13.8mm x 7.5mm/0.8 x 0.5 x 0.3inch
 

 
 
 

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

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/10 下一条
报名最后一周!2025 英飞凌消费、计算与通讯创新大会-北京站
会议时间:3月18日(周二)09:30签到
参会奖励:电动螺丝刀套装、户外登山包、京东卡

查看 »

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

 
机器人开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表