LED Board Display Demo


描述

LED董事会功能30.WS2812 LED条带that each contain 30 addressable LEDs. The board uses a uC32 to control all 900 LEDs in the board. In conjunction with theLEDboard, the creation of a 4-button controller and the game of “Snake” are included in this demo.


如何构建LED显示屏

有关原始说明书查看指导

Step 1: Materials

Required Materials for Display

  • 30 1m strips of WS2812 addressable LEDs
  • chipKIT uC32 microcontroller
  • 5V,75A电源
  • Various lengths of wire for connections

控制器所需的材料

  • RJ45Pmod connector pair
  • 4 momentary push buttons
  • 4 1kΩ resistors
  • Short wire lengths, solder, bare PCB, metal standoffs with screws, small acrylic panel

可选的材料

  • 1/4“(6.35mm)透明,无色丙烯酸片(有机玻璃)
  • 6 friction catches for cabinets
  • 强力胶
  • Acrylic cement
  • 1 /“(6.35mm)刨花板
  • 平黑色珐琅质油漆

工具

  • 带锯,手锯
  • Sandpaper and sanding block
  • 钻机用1/2“(12.7mm)和1/8”(3.2mm)钻头
  • 带截止轮的旋转工具
  • Screwdriver

第2步:设计

这strips come with a connector on each end that connects power as well as data lines to allow for serial connection, but they also have a second set of bare wires for power connections. The bare wires are used to connect the strips in parallel to the bus lines across the bottom of the panel and the connectors to pass the data signal down the line. Since the data must be serial, the strips must be connected end to end, meaning that the data comes in from the lower left and runs up the first strip, then down the second, up the third, etc. in a zig-zag pattern across the board.

第3步:建立LED板

Using one strip as a guide, mark all four edges of the acrylic with the gaps between eachLED以中心为中心LEDon the board where it needed to go to make a square array. Space the first strip lengthwise so that the first and last LEDs on it were the same distance away from the bottom and top edges of the panel. The weatherproof casing and even the strips themselves are not all perfectly 1m in length, nor is the distance from the end of the strip to the firstLED条带之间的一致性,所以仅在每个条带的一端都没有导致方形阵列。

Determine the distance from the top and bottom, then mark where the wires are coming out of the end of the strip, but back in toward the center of the strip about 1/2“ (12.7mm). The connectors for the data are about 1/2” wide. By moving the hole back about 1/2“ it allows for the strip to cover most of the hole, giving a cleaner look. Use the standing drill press and some clamps to give a much cleaner cut to the holes.

使用LED胶合,创建和连接电源总线。对于每辆总线,只要面板宽加上足够宽的电源即可使用长度为12AWG电线即可到达电源。这导致面板均具有不同的总长度,但连接到每个面板的部分是相同的。切片并以一个间隔的间隔删除小差距进入总线电线的绝缘LED,leaving the insulation in place between each connection. The wire was laid down on the back of the panel and the bare wires on theLED测量,从前面推动,切割,剥离,然后焊接到总线线上的条带。

Once all ten supply wires were soldered to the supply bus wire, the whole wire was glued down. This process was repeated for the ground bus, but the buses were placed so that the gaps were staggered between the supply and ground buses to minimize shorting. On the other end of theLED面板顶部的条带,在不需要总线电线的情况下,裸线被修剪,尽可能靠近硅胶套管,以防止在该端部缩短。总线电线和交流电源电缆都配有铁锹连接器,可连接到75A电源上的接线端子。


第4步:构建支架和控制器

Latches

将面板连接在一起时,使用三个闩锁,总共六个。在弄清楚它们的位置和修剪内部弹簧以减少张力后,钻孔螺纹孔,用于将弹簧的较大件放入面板中,只是足够深,不能通过面板一路走来。然后,使用带截止轮的旋转工具来修剪螺钉,使它们不会通过丙烯酸面板。

对于另一个闩锁,从丙烯酸中构建小块以将它们安装在垂直于面板时。使用一些丙烯酸水泥和一些废料切割丙烯酸切割以适合锁定较小的闩锁的底座,这些块将粘合在面板背面的位置。然后钻孔进入这些块并使用螺钉,稍微修剪此时,将第二件连接到相邻面板。

站立

现在,面板已完成并工作(代码开发将在步骤5中),它需要一个立场,这是一个简单的可收缩设计,可用于运输很好且紧凑。每个支架都有四件,两条腿和两个括号。两个较小的面板的腿之间的间距将它们置于第3和第4之间LED条各有4条在他们之间,or about 6 1/2” (16.5cm). The spacing on the third stand is about 5“ wider since that panel is about 5” wider than the other two. Use a simple mated-notch design to build the stands, wherein the legs and braces have corresponding notches, all cut to a depth of 1/2 the width of the brace. These notches line up when assembled, making the stand simple yet strong. Once completed, the stands can be given a coat of flat black enamel paint.

控制器

建设的最后一件事是游戏控制器。首先将按钮放在标准上/向下/左/右钻石图案中。然后焊接6针,90deg成角度的头部到电路板上以允许安装雌性RJ45Pmod. +5V andGND.将直接来自MAX32RJ45PMODS。四个按钮中的每一个的一侧被绑在头部上的其他四个引脚上,每个按钮的下拉电阻,连接在同一个标​​题销之间GND.,as well. +5V is attached to the other side of each button. The signal back to the Max32 is driven toGND.(逻辑低电平)通过下拉电阻直到按下按钮,此时引脚被驱动到+ 5V(逻辑高)。如果您希望逻辑低电平触发代码以执行某些操作,则这种设计很容易颠倒。一旦董事会焊接在一起,底部的焊点有点尖锐。

第5步:软件

要正确运行蛇程序,必须先安装PICxel Library。This library provides software designed to be used with the WS2812LEDstrip. We'll check out the main driving force that allows our particular 30×30 array of LEDs to run as planned: the PICxel library. This library is surprisingly simple and straightforward to use. To start out and initialize the array of all 900 LEDs we first call the construction for the PICxel class: PICxel name_of_the_set_of_LEDs( how_many_LEDs_we_have, which_pin_the_data_is_being_sent_from_to_the_LEDs, color_mode);

Here we can provide how LEDs we are running (900), which pin the data is going to be used to connect to the data line on the LEDs (pin 3 in our case), and the desired color mode. Marshall's library supports two different color modes: GRB (RGB in a different order), and HSV. Our snake game happens to be using HSV since that allowed more flexibility for the user to choose both a color and the brightness. We can get the LEDs lit up and running by first calling in our setup the name_of_the_set_of_LEDs.begin();

功能,然后选择LED的设置,随后使用我们的新值更新LED的条带。对于HSV颜色模式,您可以设置色调,饱和度和值。对于那些可能不知道的人来说,这些值大致转换为颜色,如何“粗体”特定颜色而不是被冲出,以及如何分别为“亮”颜色而不是暗。这些都以下列功能设置:name_of_the_set_of_leds.hsvsetledcolor(哪个_LED_out_of_your_set_you_want_to_change, hue, saturaturation, value);

此功能只会仅设置(但尚未更新)仅在一个上的值LED,so it's recommend to use a for loop to change multipleLED价值观。更新LED,以便它们都显示出新的设置(如果特定的话)LEDwas not updated), simply issue the following command: name_of_the_set_of_LEDs.refreshLEDs();

这refresheLEDs() function utilizes port manipulation and assembly code to make for a tight library so very little time is wasted in sending out the new information to the WS2812 LEDs at their designated data rate. You can check out a screen shot of the HSV demo for this library in the picture for this step.

here有关将库安装到MPIDE的教程。

下载Snake,then upload the program onto the uC32.