首页
/
每日頭條
/
圖文
/
新年燈籠手工制作高難度
新年燈籠手工制作高難度
更新时间:2024-11-26 13:40:52

自制酷炫的新年燈籠

新年了,燈籠是非常有代表性的新年物件。紅紅火火的燈籠,既有美好的寓意,也是點綴新年的裝飾,還有實用的照明功效。作為DIY愛好者,必須自己做一個。

大概思路:使用ws2812b幻彩燈帶,配合亞克力闆,闆上刻上各種祝福語,投射出炫麗效果來;框架采用3D打印;控制闆使用esp01s,(配合直插led模塊),連接wifi使用BLINKER進行手機遠程控制;頂部300減速電機(5轉/分)使燈籠旋轉;3節5号電池供電。

材料與成本:整體還是比較便宜,esp01s,6元;RGB模塊,5元;減速電機、亞克力和3d打印材料都是幾塊錢。最貴的卻是電池,為了堅持長一點的時間,用的比較好的1.5恒壓充電電池,二十塊左右一顆,幾個燈籠電池花了一百多。三顆電池能堅持近二十個小時,幾塊錢的比較好的一次性堿性電池,時間差不多,但是每天都得換電池。

外殼:

新年燈籠手工制作高難度(自制酷炫的新年燈籠)1

Ws2812b燈帶:

新年燈籠手工制作高難度(自制酷炫的新年燈籠)2

亞克力面闆:

新年燈籠手工制作高難度(自制酷炫的新年燈籠)3

Esp01s:

新年燈籠手工制作高難度(自制酷炫的新年燈籠)4

減速電機:

新年燈籠手工制作高難度(自制酷炫的新年燈籠)5

Blinker控制:

新年燈籠手工制作高難度(自制酷炫的新年燈籠)6

App配置了幾個控制按鈕:

新年燈籠手工制作高難度(自制酷炫的新年燈籠)7

亮燈和黑暗環境下:

新年燈籠手工制作高難度(自制酷炫的新年燈籠)8

外殼改進了一點的新版本:

新年燈籠手工制作高難度(自制酷炫的新年燈籠)9

新年燈籠手工制作高難度(自制酷炫的新年燈籠)10

一對燈籠,紅紅火火!

新年燈籠手工制作高難度(自制酷炫的新年燈籠)11

改進版新年燈籠

附錄代碼:

#include <Adafruit_NeoPixel.h> #include <SimpleTimer.h> volatile int g_ms; volatile int g_ld; volatile int g_xh; volatile boolean g_zs; Adafruit_NeoPixel rgb_display_2 = Adafruit_NeoPixel(12,2,NEO_GRB NEO_KHZ800); SimpleTimer timer; #define BLINKER_WIFI #include <Blinker.h> char auth[] = "xxxxxxxxxxx"; char ssid[] = "xxxxx"; char pswd[] = "xxxxxxxx"; // uint32_t Wheel(byte WheelPos){ if(WheelPos < 85){ return rgb_display_2.Color(WheelPos * 3, 255 - WheelPos * 3, 0); } else if(WheelPos < 170){ WheelPos -= 85; return rgb_display_2.Color(255 - WheelPos * 3, 0, WheelPos * 3); } else{ WheelPos -= 170; return rgb_display_2.Color(0, WheelPos * 3, 255 - WheelPos * 3); } } void rainbow(uint8_t wait){ uint16_t i, j; for(j=0; j<256; j ){ for(i=0; i<rgb_display_2.numPixels(); i ){ rgb_display_2.setPixelColor(i, Wheel((i j) & 255)); } rgb_display_2.show(); delay(wait); } } BlinkerRGB RGB1("yanse"); void RGB1_callback(uint8_t r_value, uint8_t g_value, uint8_t b_value, uint8_t bright_value) { g_zs = false; g_ld = bright_value; rgb_display_2.setBrightness(bright_value); for (int i = 1; i <= 12; i = i (1)) { rgb_display_2.setPixelColor((i)-1, ((r_value & 0xffffff) << 16) | ((g_value & 0xffffff) << 8) | b_value); rgb_display_2.show(); delay(50); } } BlinkerButton Button2("btn-ss"); void Button2_callback(const String & state) { g_ms = 2; g_zs = true; } BlinkerButton Button3("btn-hx"); void Button3_callback(const String & state) { g_ms = 3; g_zs = true; } BlinkerButton Button4("btn-ch"); void Button4_callback(const String & state) { g_ms = 4; g_zs = true; } BlinkerButton Button5("btn-xz"); void Button5_callback(const String & state) { g_ms = 5; g_zs = true; } BlinkerButton Button6("btn-xh"); void Button6_callback(const String & state) { g_ms = 6; g_zs = true; } void shanshuo() { for (int j = 1; j <= 3; j = j (1)) { for (int i = 1; i <= 12; i = i (1)) { rgb_display_2.setPixelColor((i)-1, ((255 & 0xffffff) << 16) | ((0 & 0xffffff) << 8) | 0); rgb_display_2.show(); } delay(100); for (int i = 1; i <= 12; i = i (1)) { rgb_display_2.setPixelColor((i)-1, ((0 & 0xffffff) << 16) | ((0 & 0xffffff) << 8) | 0); rgb_display_2.show(); } delay(50); } for (int j = 1; j <= 3; j = j (1)) { for (int i = 1; i <= 12; i = i (1)) { rgb_display_2.setPixelColor((i)-1, ((255 & 0xffffff) << 16) | ((255 & 0xffffff) << 8) | 0); rgb_display_2.show(); } delay(100); for (int i = 1; i <= 12; i = i (1)) { rgb_display_2.setPixelColor((i)-1, ((0 & 0xffffff) << 16) | ((0 & 0xffffff) << 8) | 0); rgb_display_2.show(); } delay(50); } for (int j = 1; j <= 3; j = j (1)) { for (int i = 1; i <= 12; i = i (1)) { rgb_display_2.setPixelColor((i)-1, ((0 & 0xffffff) << 16) | ((255 & 0xffffff) << 8) | 0); rgb_display_2.show(); } delay(100); for (int i = 1; i <= 12; i = i (1)) { rgb_display_2.setPixelColor((i)-1, ((0 & 0xffffff) << 16) | ((0 & 0xffffff) << 8) | 0); rgb_display_2.show(); } delay(50); } for (int j = 1; j <= 3; j = j (1)) { for (int i = 1; i <= 12; i = i (1)) { rgb_display_2.setPixelColor((i)-1, ((0 & 0xffffff) << 16) | ((255 & 0xffffff) << 8) | 255); rgb_display_2.show(); } delay(100); for (int i = 1; i <= 12; i = i (1)) { rgb_display_2.setPixelColor((i)-1, ((0 & 0xffffff) << 16) | ((0 & 0xffffff) << 8) | 0); rgb_display_2.show(); } delay(50); } for (int j = 1; j <= 3; j = j (1)) { for (int i = 1; i <= 12; i = i (1)) { rgb_display_2.setPixelColor((i)-1, ((0 & 0xffffff) << 16) | ((0 & 0xffffff) << 8) | 255); rgb_display_2.show(); } delay(100); for (int i = 1; i <= 12; i = i (1)) { rgb_display_2.setPixelColor((i)-1, ((0 & 0xffffff) << 16) | ((0 & 0xffffff) << 8) | 0); rgb_display_2.show(); } delay(50); } for (int j = 1; j <= 3; j = j (1)) { for (int i = 1; i <= 12; i = i (1)) { rgb_display_2.setPixelColor((i)-1, ((255 & 0xffffff) << 16) | ((0 & 0xffffff) << 8) | 255); rgb_display_2.show(); } delay(100); for (int i = 1; i <= 12; i = i (1)) { rgb_display_2.setPixelColor((i)-1, ((0 & 0xffffff) << 16) | ((0 & 0xffffff) << 8) | 0); rgb_display_2.show(); } delay(50); } for (int i = 1; i <= 12; i = i (1)) { rgb_display_2.setPixelColor((i)-1, ((255 & 0xffffff) << 16) | ((0 & 0xffffff) << 8) | 0); rgb_display_2.show(); } rgb_display_2.setBrightness(g_ld); rgb_display_2.show(); } void Simple_timer_1() { if (g_zs) { rgb_display_2.setBrightness(g_ld); rgb_display_2.show(); switch (g_ms) { case 2: shanshuo(); break; case 3: huxi(); break; case 4: rainbow(50); rgb_display_2.show(); break; case 5: xuanzh(); break; case 6: g_xh = g_xh 1; if (g_xh == 5) { g_xh = 1; } switch (g_xh) { case 1: xuanzh(); break; case 2: huxi(); break; case 3: rainbow(20); rgb_display_2.show(); break; case 4: shanshuo(); break; } break; } } } void huxi() { for (int j = 1; j <= 5; j = j (1)) { for (int i = 1; i <= 32; i = i (1)) { rgb_display_2.setBrightness((i * 3)); rgb_display_2.show(); delay(20); } delay(100); for (int i = 32; i >= 1; i = i (-1)) { rgb_display_2.setBrightness((i * 3)); rgb_display_2.show(); delay(20); } } rgb_display_2.setBrightness(g_ld); rgb_display_2.show(); } void xuanzh() { for (int j = 1; j <= 2; j = j (1)) { for (int i = 1; i <= 12; i = i (1)) { rgb_display_2.setPixelColor((i)-1, ((255 & 0xffffff) << 16) | ((0 & 0xffffff) << 8) | 0); rgb_display_2.show(); delay(40); } for (int i = 1; i <= 12; i = i (1)) { rgb_display_2.setPixelColor((i)-1, ((255 & 0xffffff) << 16) | ((255 & 0xffffff) << 8) | 0); rgb_display_2.show(); delay(40); } for (int i = 1; i <= 12; i = i (1)) { rgb_display_2.setPixelColor((i)-1, ((0 & 0xffffff) << 16) | ((255 & 0xffffff) << 8) | 0); rgb_display_2.show(); delay(40); } for (int i = 1; i <= 12; i = i (1)) { rgb_display_2.setPixelColor((i)-1, ((0 & 0xffffff) << 16) | ((255 & 0xffffff) << 8) | 255); rgb_display_2.show(); delay(40); } for (int i = 1; i <= 12; i = i (1)) { rgb_display_2.setPixelColor((i)-1, ((0 & 0xffffff) << 16) | ((0 & 0xffffff) << 8) | 255); rgb_display_2.show(); delay(40); } for (int i = 1; i <= 12; i = i (1)) { rgb_display_2.setPixelColor((i)-1, ((255 & 0xffffff) << 16) | ((0 & 0xffffff) << 8) | 255); rgb_display_2.show(); delay(40); } } } void setup(){ g_ms = 6; g_ld = 60; g_xh = 0; g_zs = true; rgb_display_2.begin(); Blinker.begin(auth,ssid,pswd); rainbow(30); rgb_display_2.show(); RGB1.attach(RGB1_callback); Button2.attach(Button2_callback); Button3.attach(Button3_callback); Button4.attach(Button4_callback); Button5.attach(Button5_callback); Button6.attach(Button6_callback); timer.setInterval(10000L, Simple_timer_1); } void loop(){ //1、yanse,顔色與亮度;2、btn-ss,閃爍;3、btn-hx,呼吸; //4、btn-ch,彩虹;5、btn-xz,旋轉;6、btn-xh,循環。 Blinker.run(); timer.run(); }

Blinker界面配置:

{¨config¨{¨headerColor¨¨transparent¨¨headerStyle¨¨light¨¨background¨{¨img¨´´}}¨dashboard¨|{¨type¨¨col¨¨t0¨¨顔色亮度¨¨clr¨¨#389BEE¨¨bg¨Ë¨cols¨Ï¨rows¨Ï¨key¨¨yanse¨´x´Ê´y´Ê¨speech¨|÷¨lstyle¨É}{ß8¨btn¨¨ico¨¨fad fa-lightbulb-on¨¨mode¨ÊßA¨閃爍¨¨t1¨¨文本2¨ßEËßFËßGËßH¨btn-ss¨´x´Ï´y´ÒßJ|÷ßKÉßC¨#076EEF¨}{ß8ßLßM¨fad fa-heartbeat¨ßOÊßA¨呼吸¨ßQßRßEËßFËßGËßH¨btn-hx¨´x´Ë´y´ÒßJ|÷ßKÉßC¨#EA0909¨}{ß8ßLßM¨fad fa-sun¨ßOÉßA¨彩虹¨ßQßRßEËßFËßGËßH¨btn-ch¨´x´É´y´ÒßJ|÷ßC¨#FBA613¨}{ß8ßLßM¨fad fa-repeat-alt¨ßOÉßA¨循環¨ßQßRßEËßFËßGËßH¨btn-xh¨´x´Ì´y´¤CßJ|÷ßC¨#00A90C¨}{ß8ßLßM¨fad fa-fan¨ßOÉßA¨旋轉¨ßQßRßEËßFËßGËßH¨btn-xz¨´x´Í´y´ÒßJ|÷ßC¨#6010E4¨}÷¨actions¨|¦¨cmd¨¦¨switch¨‡¨text¨‡¨on¨¨打開?name¨¨off¨¨關閉?name¨—÷¨triggers¨|{¨source¨ßm¨source_zh¨¨開關狀态¨¨state¨|ßoßq÷¨state_zh¨|¨打開¨¨關閉¨÷}÷}

,
Comments
Welcome to tft每日頭條 comments! Please keep conversations courteous and on-topic. To fosterproductive and respectful conversations, you may see comments from our Community Managers.
Sign up to post
Sort by
Show More Comments
推荐阅读
ps4 暗黑破壞神2beta
ps4 暗黑破壞神2beta
《暗黑破壞神》系列即将在12月31日迎來系列20周年!暴雪也為此特地推出了特别紀念活動,據悉其中包括玩家可以在《暗黑破壞神3》中重新體驗《暗黑破壞神1》、《守望先鋒》中将加入暗黑系列主題噴漆與頭像、《爐石傳說》的酒館亂鬥中玩家可以和暗黑系列...
2024-11-26
無霧加濕器評測推薦
無霧加濕器評測推薦
現在已經是11月了,“今年冬天又是一個寒冬”這種說法也是不絕于耳。在秋冬季節長時間的開空調開暖氣,會導緻嗓子不舒服、皮膚掉皮、起靜電,這些是我們每年冬天都要經曆的必修課。下面我就來和大家聊一聊冬季的必需品——加濕器,為接下來的寒冬做好準備。...
2024-11-26
各球員對郭艾倫評價
各球員對郭艾倫評價
直播吧11月19日訊微博CBA官方今日公布了常規賽第一階段焦點球員微博熱力值排行榜,同時公布了第一階段比賽中,CBA相關内容共有127次登上熱搜,其中郭艾倫就有11次。微博CBA從熱搜數量、視頻播放量、相關話題閱讀量、相關博文數量4個維度,...
2024-11-26
曲靖京東商城利潤有多少
曲靖京東商城利潤有多少
雲南最大京東電器城市旗艦店即将于4月29日試營業,此店位于曲靖市麒麟區麒麟南路365号金城百貨商場内,共三層,建地面積12000平方米,包含電子産品、家電家居和體驗區域。在試營業期間,京東電器還有大量優惠活動。下面,小編就給大家帶來一波探店...
2024-11-26
dm-i選哪個版本
dm-i選哪個版本
1.什麼是DMI超級混動DMl是一款插電式混合動力車型,分為純電續航51KM和純電續航110KM兩個版本,可以主動純電模式行駛,電量低自動切換為混動模式,滿油滿電綜合續航1200KM,告别充電焦慮症,上綠牌免購置稅不限行不限号。2.DMI的...
2024-11-26
Copyright 2023-2024 - www.tftnews.com All Rights Reserved