查看: 527|回复: 0

【热门器件来 Arrow】Arduino DFR0216 全彩灯带 WS2812

[复制链接]
  • TA的每日心情
    开心
    2024-4-16 13:36
  • 签到天数: 686 天

    连续签到: 1 天

    [LV.9]以坛为家II

    发表于 2022-11-29 21:38:46 | 显示全部楼层 |阅读模式
    分享到:


      收到开发板已经有一些时间了,今天特意来个开箱。
      先上图,来个集体照:
      1.jpg
      DFR0216正面照片:
      2.jpg
      DFR0299照片:
      3.jpg
      DFR0868照片:
      4.jpg
      两兄弟来一个合照:
      5.jpg
      我准备的硬件:
      一个喇叭,不知道能不能推的响。
      6.jpg
      一个WS2812 RGB灯条,这个灯点亮了,色调爽爽的,很好看:
      7.jpg

      最近收到了Arduino UNO R3 开发板很是激动,视如珍宝,特此在论坛贴一篇出来
      一、硬件部分
      1. Arduino UNO R3 开发板
      1669732450855.jpg
      1669732468434.jpg




      板子漂亮,拍出来的照片都好看。




      板子各引脚定义说明:




      1669732816335.jpg




      MCU映射:
      ATmega328的引脚图,Atmega8,168和328是相同的。
      1669732894152.jpg
      2. 基于WS2812B的LED灯条
      51e31c42bedec5108866b404fd0f6ef.jpg
      3. 杜邦线
      cb41f92071af13119ddfd8b44920924.jpg
      原理图:
      1669733713315.jpg
      软件部分
      LED灯条驱动
      #define LED_PIN     6 //输出的引脚
      #define LED_COUNT  8   //外设上有多少个RGB灯珠
      #define BRIGHTNESS 50   //亮的亮度调节,最亮是255,最低是0.

      //下面是灯的色,灯的色有255*255*255
        colorWipe(strip.Color(255,   0,  0)     , 50);
        colorWipe(strip.Color( 0, 255,   0)     , 50);
        colorWipe(strip.Color( 0,   0, 255)    , 50);
        colorWipe(strip.Color( 0,   0,  0, 255), 50);
        colorWipe(strip.Color( 127,   127,  127), 50);
        colorWipe(strip.Color( 127,   0,  0 ), 50);
        colorWipe(strip.Color( 40,   0,  120), 50);

      //实现点灯,用FRO循环
        for(int k=0; k<whiteLoops; k++) {
          for(int j=0; j<256;j++) {
            strip.fill(strip.Color(0, 0, 0, strip.gamma8(j)));
            strip.show();
          }
          delay(1000);
          for(int j=255; j>=0;j--) {
            strip.fill(strip.Color(0, 0, 0, strip.gamma8(j)));
            strip.show();
          }
        }
      二、硬件连接
      借用一下人家的图片,电源是接的5V,GND,输出脚是6脚。
      1669734127360.jpg
      三、点亮灯条
      53d387976fb755f80a6ba6d01065673.jpg
      视频:


    回复

    使用道具 举报

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

    本版积分规则

    关闭

    站长推荐上一条 /2 下一条

    手机版|小黑屋|与非网

    GMT+8, 2024-4-25 16:10 , Processed in 0.110062 second(s), 16 queries , MemCache On.

    ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.