首页
/
每日頭條
/
圖文
/
新年燈籠手工制作高難度
新年燈籠手工制作高難度
更新时间:2024-12-27 02:28:05

自制酷炫的新年燈籠

新年了,燈籠是非常有代表性的新年物件。紅紅火火的燈籠,既有美好的寓意,也是點綴新年的裝飾,還有實用的照明功效。作為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
推荐阅读
四月新番戀愛動漫推薦
四月新番戀愛動漫推薦
導讀:1月新番《堀與宮村》B站目前評分較高的一部新番之一,故事很簡單,女主在學校是個魅力大方的少女,成績還很優秀,在同年級人氣很高,是個十分完美的女孩。嗯,畫面很美,我很喜歡。很有居家女孩的感覺。男主在學校卻是普普通通的,一抓一大把的那種,...
2024-12-27
cdr怎麼讓字體跟着圖形走
cdr怎麼讓字體跟着圖形走
CDR如何使字體或形狀等距離排列最近需要名片的客戶越來越多,随之我們排的名片也是越來越多,客戶網上聯系我們自己的排版的時候硬性要求沒那麼強,不齊的時候我還能自己慢慢的調,調齊就行,打開CDR上面找到排列點開找到對齊和分布,有快捷鍵的但是我的...
2024-12-27
山東棗莊台兒莊古城景區
山東棗莊台兒莊古城景區
乘搖橹船穿梭如畫夜色中,聽酒吧歌手淺吟低唱,沉浸在流光溢彩的夜生活中……快來打卡體驗璀璨夜景下的台兒莊古城,近距離感受“一河漁火、歌聲十裡”的美景。台兒莊曆史文化深厚,形成于漢,發展于元,繁榮于明清。京杭大運河中河台兒莊段全長3.3公裡,是...
2024-12-27
小語種口譯專業就業前景
小語種口譯專業就業前景
大學報考的專業當中,在20.30年前,英語絕對算得上是高大上的一種。後來一窩蜂的越來越多的學生,報考英語。很快英語專業逐漸顯示出頹勢,學習的學生過多,崗位比較少。我國的國際地位提高和人工智能的取代等等,于是很多同學另辟蹊徑,小語種成了另一種...
2024-12-27
qq糖的做法做果凍用酸奶
qq糖的做法做果凍用酸奶
不加任何防腐劑的果凍By非兒愛美食用料白涼粉30克水300ml芒果1個草莓2個0卡糖20克做法步驟1、準備材料2、芒果和草莓切丁3、白涼粉和水放入奶鍋中4、加入糖小朵0卡糖5、攪拌均勻後,中小火煮至沸騰6、碟子裡鋪保鮮膜,加水果丁,倒入煮好...
2024-12-27
Copyright 2023-2024 - www.tftnews.com All Rights Reserved