### Warm reminder (First of all, I would like to thank Lichuang for always having various activities that allow us to "buy prostitutes" for various things) This was made in a previous activity of Lichuang, and it has been dragged on until now. To improve, some issues need to be explained in advance at the beginning of the text. The idea of a Christmas tree came from the LED Christmas tree made by my previous lab brother. Due to the use of WS2812RGB lamp beads, the result of the work is not as good as expected. It is recommended that the board be made larger if conditions permit. ![Screenshot 2021-12-19 162046.png]

It can be seen that each of my leaves has only 4 lamp beads, and the look and feel in the actual picture is average. I will compare it with the LED light Christmas tree later. In fact, it was 4+1 at the beginning, but later it was found that the blade could not be welded and the spacing was too small, so it was changed to 3+1. In fact, you don’t need so many intermediate capacitors. You can increase or decrease them according to your needs. - - - ### Project Introduction This is an RGB Christmas tree based on 51 microcontroller, using STC15W series microcontroller and WS2812B model RGB lamp beads. It currently has three functions: single lighting of one color, lighting in the form of colored lights, and breathing effect. Currently, there are two buttons reserved on the base plate, one in the middle of the two M3 screw holes on each side, for easy blind pressing. - - - ### Project function introduction* Due to the characteristics of RGB lights, you can light up the desired color through programming; * Two buttons are reserved on the base plate to facilitate the design of various lighting schemes; - - - ### Project Attributes* [x] Schematic design* [x] PCB design* [x] PCB proofing* [x] Welding test* [x] Functional test* [x] Program test - - - ### Circuit explanation This is the baseboard The schematic diagram can be seen to be very simple, just USB+switch circuit+chip, as well as the chip's programming pins, screw holes and two button circuits. ![Schematic_RGB lights-Christmas tree_2021-12-19.png]

- - - ### Software```` C void main() { STC15W_IOinit(); //STC15W microcontroller pin initialization function while(1) { Scan_Key( ); //Independent key scanning function switch(i) { case 1:WS2812B_Show_Same_Color_Num(1,100);break; //WS2812B lantern driver each light display color function case 2:WS2812B_Show_Squence_Color_Num(0,100);break; //WS2812B lantern Drive each light to display the color function in sequence default: WS2812B_Show_Huxi2_Color_Num(); //WS2812B colored lights drive each light to breathe effect} } } ``` - - - ### This picture is a mistake I made when drawing the schematic diagram before, which resulted in flying The line was sorted out and it was a bit ugly. ![WeChat picture_20211219220207.jpg]

This is to compare with the senior brother’s previous LED Christmas tree. (I feel that the LED lights are better looking, the light group is smaller, and the proportions are more coordinated) ![WeChat picture_20211219221109.jpg]

- - - ### Notes* When arranging RBG lights, be sure to pay attention to the spacing to avoid causing the soldering iron tip to be too large And the RGB lamp cannot be welded or damaged. * When programming the program, be sure to pay attention to the clock frequency (the routine is 20MHz) * The video effect is not as good as on-site. If you are interested, you can solder it yourself - - -