RGB marix led点阵屏--蓝牙音乐频谱播放器
http://v.youku.com/v_show/id_XMzMyNjEzMzE2MA==.html?spm=a2hzp.8244740.0.0黑色点阵金属边框的深沉feel,幽兰迷离等效曲风自然跳跃的 new york city。
这一切的全部归结于RGB matrix led点阵屏
准备工作:
IDC转接线 x1
电源连接线 x1
arduino uno x132x16
RGB LED Matrix - 6mm pitch 点阵屏 x1
接口说明:
测试电路连线:
示例代码:
// scrolltext demo for Adafruit RGBmatrixPanel library.
// Demonstrates double-buffered animation on our 16x32 RGB LED matrix:
// <a href="http://www.adafruit.com/products/420" target="_blank">http://www.adafruit.com/products/420</a>
// Written by Limor Fried/Ladyada & Phil Burgess/PaintYourDragon
// for Adafruit Industries.
// BSD license, all text above must be included in any redistribution.
#include <Adafruit_GFX.h> // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library
// Similar to F(), but for PROGMEM string pointers rather than literals
#define F2(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define CLK 8// MUST be on PORTB! (Use pin 11 on Mega)
#define LAT A3
#define OE9
#define A A0
#define B A1
#define C A2
// Last parameter = 'true' enables double-buffering, for flicker-free,
// buttery smooth animation.Note that NOTHING WILL SHOW ON THE DISPLAY
// until the first call to swapBuffers().This is normal.
RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, true);
// Double-buffered mode consumes nearly all the RAM available on the
// Arduino Uno -- only a handful of free bytes remain.Even the
// following string needs to go in PROGMEM:
const char str[] PROGMEM = "DFRobot";
int textX = matrix.width(),
textMin = sizeof(str) * -12,
hue = 0;
int8_t ball = {
{3,0,1,1 }, // Initial X,Y pos & velocity for 3 bouncy balls
{ 17, 15,1, -1 },
{ 27,4, -1,1 }
};
static const uint16_t PROGMEM ballcolor = {
0x0080, // Green=1
0x0002, // Blue=1
0x1000// Red=1
};
void setup() {
matrix.begin();
matrix.setTextWrap(false); // Allow text to run off right edge
matrix.setTextSize(2);
}
void loop() {
byte i;
// Clear background
matrix.fillScreen(0);
// Bounce three balls around
for(i=0; i<3; i++) {
// Draw 'ball'
matrix.fillCircle(ball
, ball
, 5, pgm_read_word(&ballcolor
));
// Update X, Y position
ball
+= ball
;
ball
+= ball
;
// Bounce off edges
if((ball
== 0) || (ball
== (matrix.width() - 1)))
ball
*= -1;
if((ball
== 0) || (ball
== (matrix.height() - 1)))
ball
*= -1;
}
// Draw big scrolly text on top
matrix.setTextColor(matrix.ColorHSV(hue, 255, 255, true));
matrix.setCursor(textX, 1);
matrix.print(F2(str));
// Move text left (w/wrap), increase hue
if((--textX) < textMin) textX = matrix.width();
hue += 7;
if(hue >= 1536) hue -= 1536;
// Update display
matrix.swapBuffers(false);
}
演示效果:
32x32 RGB LED Matrix - 4mm pitch 点阵屏
线路连接:
演示效果:
Rgb matrix panel库函数:RGBmatrixPannel::color333(uint8_t r, uint8_tg, uint8_t b)//promote 3/3/3 rgb to adafruit_gfx 5/6/5 将3/3/3颜色比例转换为5/6/5RRRGGGBBB->RRRrrGGGgggBBBbb类似color444(uint8_t r, uint8_tg, uint8_t b); color888(uint8_t r, uint8_tg, uint8_t b);选用color888 r/g/b8为 2的8次方等于256,方便对照rgb颜色对照表;
Fillscreen(uint16_t c) 填充屏幕cColorhsv 由rgb到hsv颜色空间的理解:Drawpixel(int16_t x, int16_t y, uint16_t c) 绘制像素点由于需要在arduino上进行声音处理,就需要FFT变换(快速傅里叶变换).傅里叶变化概念.复数的概念.欧拉公式好像记忆里大学的信号的数据分析原理以及通讯原理讲过;蓝牙音频的接口电路示意图如上;我们还用到arduino mega2560进行控制和fft转换接线细节如下: 大神,你这个蓝牙模块接线图有没有详细的呀,代码有没有分享的,求分享邮箱xyywo@163.com 我想问如果想在点阵屏上想显示相应的字,并且移动该如何做。一个一个点亮吗?还是有什么新的方法。求详细解析。邮箱1572662276@qq.com 艾森豪威尔 发表于 2018-9-10 10:00
我想问如果想在点阵屏上想显示相应的字,并且移动该如何做。一个一个点亮吗?还是有什么新的方法。求详细解 ...
这个代码我不怎么能看懂 这个点阵屏连线满复杂 还用到了IO传感器扩展板吗?
页:
[1]