(SKU:DFR0598) 12x48 Flexible RGB LED Matrix

来自DFRobot Product Wiki
跳转至: 导航搜索

目录

简介

新型1248RGB软屏,采用12*48颗灯珠组成,主要用于背包、酒瓶、衣服、腰带、表带、帽子、手镯;该LED柔性屏软屏,灯珠紧凑美观,亮度高,性能稳定,板面简洁,美观,生产方便,故障率低,是灯饰亮化的理想设计选择。

技术规格

  • 安装方式: 镶嵌式
  • 最大工作电流: 970mA(最高亮度)
  • 工作电压:5.0V
  • 分辨率 12x48点
  • 模块尺寸:160mm x 36mm
  • 屏幕尺寸: 143x29mm(mm)
  • 可显示颜色:红、黄、绿、青、兰、紫、白、黑
  • 控制方式:串口通信

引脚说明

12x48 Flexible RGB LED Matrix
引脚说明
名称 功能描述
VCC 电源正极
GND 电源负极
RX 串口输入
TX 串口输出








函数库列表

显示中文信息

函数原型:bool disChiCharacter(eMoveMode_t m_, eColorMode_t c_,const unsigned char *message_, uint16_t len_);
  • 函数功能:在软屏上显示中文
  • 参 数:
    • eMoveMode_t m_:显示模式
      • eMove_left:左移
      • eMove_right:右移
      • eMove_hold:保持
      • eMove_down:下移
      • eMove_up:上移
      • eMove_flash:闪烁
      • eMove_marquee:跑马灯
    • eColorMode_t c_:字体颜色
      • eColor_red:红色
      • eColor_yellow:黄色
      • eColor_green:绿色
      • eColor_cyan:青色
      • eColor_blue:蓝色
      • eColor_purple:紫色
      • eColor_white:白色
    • econst unsigned char *message_:字体取模数组

例:

#include <Arduino.h>
#include <HardwareSerial.h>
#include <SoftwareSerial.h>
#include "DFRobot_SerialScreen1248.h"

#ifdef ARDUINO_AVR_UNO
SoftwareSerial Serial1(2, 3); //RX, TX
#endif

DFRobot_SerialScreen1248 screen;

unsigned char dis[]={0x10,0x20,0x40,0x10,0x82,0x10,0x28,0x2F,0xFE,0xE4,0x82,0x10,0x44,0xA9,0x02,0x22,
                     0x82,0xFE,0x82,0xA1,0xF8,0x20,0x8F,0x10,0x7C,0xA2,0x08,0xFC,0x82,0x10,0x44,0xA5,
                     0x10,0x22,0x82,0xFC,0x44,0xA0,0xE0,0x70,0x83,0x44,0x44,0xAF,0x1E,0x68,0xEE,0x44,
                     0x58,0xA3,0xF8,0xA7,0x82,0x28,0x42,0x22,0x08,0x20,0x82,0x10,0x42,0x23,0xF8,0x20,
                     0x82,0x28,0x3E,0x62,0x08,0x20,0x86,0xC6,};//Font type Song body 9 font "创客科技"

void setup() {
    Serial.begin(115200);
    Serial1.begin(19200);
    screen.begin(Serial1);
    screen.setDbgSerial(Serial);
    screen.disChiCharacter(eMove_hold,eColor_red,dis,sizeof(dis));//Still display red "创客科技"
}

void loop() {

}

设置屏幕开关

函数原型:bool powerOn();
          bool shutDown();
  • 函数功能:控制屏幕开关

例:

#include <Arduino.h>
#include <HardwareSerial.h>
#include <SoftwareSerial.h>
#include "DFRobot_SerialScreen1248.h"

#ifdef ARDUINO_AVR_UNO
SoftwareSerial Serial1(2, 3); //RX, TX
#endif

DFRobot_SerialScreen1248 screen;
void setup() {
    Serial.begin(115200);
    Serial1.begin(19200);
    screen.begin(Serial1);
    screen.setDbgSerial(Serial);
    delay(1000);
    screen.shutDown();      //shut down
    Serial.println("SHUT DOWN!");
    delay(5000);
    screen.powerOn();   //power ON
    Serial.println("POWER ON");
}

void loop() {

}

设置移动方式

函数原型:bool disString(eMoveMode_t m_, eColorMode_t c_,const unsigned char *message_, uint16_t len_);
  • 函数功能:设置显示信息的移动方式
  • 参 数:
    • eMoveMode_t m_:移动方式
      • eMove_left:左移
      • eMove_right:右移
      • eMove_hold:保持
      • eMove_down:下移
      • eMove_up:上移
      • eMove_flash:闪烁
      • eMove_marquee:跑马灯
    • eColorMode_t c_:显示颜色
    • const unsigned char *message_:显示字符

例:

#include <Arduino.h>
#include <HardwareSerial.h>
#include <SoftwareSerial.h>
#include "DFRobot_SerialScreen1248.h"

#ifdef ARDUINO_AVR_UNO
SoftwareSerial Serial1(2, 3); //RX, TX
#endif

DFRobot_SerialScreen1248 screen;

const char *s="DFROBOT";
void setup() {
    Serial.begin(115200);
    Serial1.begin(19200);
    screen.begin(Serial1);
    screen.setDbgSerial(Serial);
}

void loop() {
    /*Switch a mobile display mode every 2s*/
    eMoveMode_t buf[]= {eMove_left,eMove_right,eMove_hold,eMove_down,eMove_up,eMove_flash,eMove_marquee};
    for(int i = 0; i < sizeof(buf)/sizeof(eMoveMode_t); i++){
        screen.disString(buf[i],eColor_red,s,strlen(s));  //display string "DFROBOT"
        delay(2000);
    }
}

设置移动速度

函数原型:bool setMoveSpeed(eSpeedLevel_t s_)
  • 函数功能:移动速度
  • 参 数:
    • eSpeedLevel_1:Speed class 1
    • eSpeedLevel_2:Speed class 2
    • eSpeedLevel_3:Speed class 3
    • eSpeedLevel_4:Speed class 4
    • eSpeedLevel_5:Speed class 5
    • eSpeedLevel_6:Speed class 6
    • eSpeedLevel_7:Speed class 7
    • eSpeedLevel_8:Speed class 8

例:

#include <Arduino.h>
#include <HardwareSerial.h>
#include <SoftwareSerial.h>
#include "DFRobot_SerialScreen1248.h"

#ifdef ARDUINO_AVR_UNO
SoftwareSerial Serial1(2, 3); //RX, TX
#endif

DFRobot_SerialScreen1248 screen;
eBrightLevel_t bright;

void setup() {
    /*Initialize communication interface (Serial1) and debug interface (Serial)*/
    Serial.begin(115200);
    Serial1.begin(19200);
    screen.begin(Serial1);
    screen.setDbgSerial(Serial);
    screen.disString(eMove_left,eColor_red,"DFROBOT",strlen("DFROBOT"));
    /*Set the displayed moving speed level*/
    screen.setMoveSpeed(eSpeedLevel_1);

}

void loop() {
    screen.setMoveSpeed(eSpeedLevel_1);
    delay(5000);
    screen.setMoveSpeed(eSpeedLevel_8);
    delay(5000);
}

设置显示亮度

函数原型:bool setBrightness(eBrightLevel_t b_)
  • 函数功能:设置背光亮度
  • 参 数:
    • eBrightLevel_1:Brightness level 1
    • eBrightLevel_2:Brightness level 2
    • eBrightLevel_3:Brightness level 3
    • eBrightLevel_4:Brightness level 4
    • eBrightLevel_5:Brightness level 5
    • eBrightLevel_6:Brightness level 6
    • eBrightLevel_7:Brightness level 7
    • eBrightLevel_8:Brightness level 8

例:

#include <Arduino.h>
#include <HardwareSerial.h>
#include <SoftwareSerial.h>
#include "DFRobot_SerialScreen1248.h"

#ifdef ARDUINO_AVR_UNO
SoftwareSerial Serial1(2, 3); //RX, TX
#endif

DFRobot_SerialScreen1248 screen;

void setup() {
    /*Initialize communication interface (Serial1) and debug interface (Serial)*/
    Serial.begin(115200);
    Serial1.begin(19200);
    screen.begin(Serial1);
    screen.setDbgSerial(Serial);
    /*Set the brightness level of the display*/
    screen.setBrightness(eBrightLevel_1);
}

void loop() {

}


设置全屏颜色

函数原型:void setFullScreenColor(eColorMode_t color_)
  • 函数功能:设置全屏显示颜色
  • 参 数:
    • eColor_red:红色
    • eColor_yellow:黄色
    • eColor_green:绿色
    • eColor_cyan:青色
    • eColor_blue:蓝色
    • eColor_purple:紫色
    • eColor_white:白色

例:

#include <Arduino.h>
#include <HardwareSerial.h>
#include <SoftwareSerial.h>
#include "DFRobot_SerialScreen1248.h"

#ifdef ARDUINO_AVR_UNO
SoftwareSerial Serial1(2, 3); //RX, TX
#endif

DFRobot_SerialScreen1248 screen;

void setup() {
    /*Initialize communication interface (Serial1) and debug interface (Serial)*/
    Serial.begin(115200);
    Serial1.begin(19200);
    screen.begin(Serial1);
    screen.setDbgSerial(Serial);
    /*Set screen color*/
    screen.setFullScreenColor(eColor_red);
}

void loop() {
    /*Switch one screen color every 2s*/
    eColorMode_t buf[]= {eColor_red, eColor_yellow, eColor_green, eColor_cyan, eColor_blue, eColor_purple, eColor_white};
    for(int i=0; i < sizeof(buf)/sizeof(eColorMode_t); i++){
        screen.setFullScreenColor(buf[i]);
        delay(2000);
    }
}

Arduino平台应用

按照引脚说明连接好硬件,并下载样例代码到UNO中,上传成功,即可看到软屏的彩色显示效果。

准备


接线图

1248软屏接线图.png


样例代码

点击下载库文件库和例程下载库安装参考

/*!
  * file SerialScreen1248.ino
  * 
  * Display Chinese characters in different ways and colors
  * @Display Chinese characters:"创客科技"
  *
  * Copyright   [DFRobot](http://www.dfrobot.com), 2016
  * Copyright   GNU Lesser General Public License
  *
  * version  V1.0
  * date  2019-7-4
  */

#include <Arduino.h>
#include <HardwareSerial.h>
#include <SoftwareSerial.h>
#include "DFRobot_SerialScreen1248.h"

#ifdef ARDUINO_AVR_UNO
SoftwareSerial Serial1(2, 3); //RX, TX
#endif

DFRobot_SerialScreen1248 screen;

unsigned char dis[]={0x10,0x20,0x40,0x10,0x82,0x10,0x28,0x2F,0xFE,0xE4,0x82,0x10,0x44,0xA9,0x02,0x22,
                     0x82,0xFE,0x82,0xA1,0xF8,0x20,0x8F,0x10,0x7C,0xA2,0x08,0xFC,0x82,0x10,0x44,0xA5,
                     0x10,0x22,0x82,0xFC,0x44,0xA0,0xE0,0x70,0x83,0x44,0x44,0xAF,0x1E,0x68,0xEE,0x44,
                     0x58,0xA3,0xF8,0xA7,0x82,0x28,0x42,0x22,0x08,0x20,0x82,0x10,0x42,0x23,0xF8,0x20,
                     0x82,0x28,0x3E,0x62,0x08,0x20,0x86,0xC6,};//Font type Song body 9 font "创客科技"

void setup() {
    Serial.begin(115200);
    Serial1.begin(19200);
    screen.begin(Serial1);
    screen.setDbgSerial(Serial);
    screen.disChiCharacter(eMove_hold,eColor_red,dis,sizeof(dis));//Still display red "创客科技"
    /*Set the brightness level of the display*/
    screen.setBrightness(eBrightLevel_1);
    /*Set the displayed moving speed level*/
    screen.setMoveSpeed(eSpeedLevel_1);
}

void loop() {

}

显示效果

1248软屏显示效果.jpg


个人工具
名字空间

变换
操作
导航
工具箱