Cov txheej txheem:

Halloween Cheerlights: 4 Kauj Ruam (nrog Duab)
Halloween Cheerlights: 4 Kauj Ruam (nrog Duab)

Video: Halloween Cheerlights: 4 Kauj Ruam (nrog Duab)

Video: Halloween Cheerlights: 4 Kauj Ruam (nrog Duab)
Video: The Reflection of Our Daughter in Law & the Halloween Mask ◇ Nyab Tus Duab & Lub Looj Ntsej Muag Dab 2024, Kaum ib hlis
Anonim
Xus Cheerlights
Xus Cheerlights

Hauv Xus zaum kawg kuv txiav txim siab los tsim ib qhov haujlwm rau lub caij. Siv tus qauv 3D ntawm tus dab uas kuv tau luam tawm ntawm Prusa i3 thiab Cheerlights project kuv tau tsim Xus kho kom zoo nkauj uas hloov xim xim.

Txoj haujlwm Cheerlight yog qhov haujlwm qhib uas ua haujlwm txhua lub teeb pom kev zoo uas siv nws. Los ntawm Twitter, siv #cheerlight hashtag, peb tau xaiv xim los ntawm Cheerlights project xim palette. Txhua lub cuab yeej uas txuas nrog rau txoj haujlwm Cheerlights nyeem xim los ntawm api thiab hloov lawv cov xim rau qhov ntawd. Los ntawm tweet nws tuaj yeem hloov xim ntawm txhua lub cuab yeej ntawm ntiaj chaw txuas nrog rau txoj haujlwm.

Kauj Ruam 1: Cov Ntaub Ntawv thiab Cov Cuab Yeej

Khoom siv

  • ESP-01
  • Awg 22 Cable
  • Coj nplhaib WS2812
  • Lub roj teeb tuav
  • Roj teeb
  • Poj Niam Qhov Ntsuas Kab Pins
  • Protoboard
  • Solder

Cov cuab yeej

  • 3D Tshuab Luam Ntawv
  • Soldering hlau

Qauv 3D

Ntxim Hlub puag Kuv

Kauj ruam 2: Sib dhos

Los ua ke
Los ua ke
Los ua ke
Los ua ke
Los ua ke
Los ua ke

Ua ntej nws yog qhov tsim nyog los tsim kev txhawb nqa rau kev sib txuas. Qhov no tau tsim los siv protoboard, poj niam lub qhov rau ESP-01 thiab cov laug. Cov poj niam lub qhov tso cai yooj yim tshem ESP-01 rau siv hauv lwm qhov haujlwm lossis hloov nws thaum ua tsis tiav. Cov laug tau siv los txhim kho cov khoom siv thiab tsim cov kab sib txuas. Lub protoboard los ua ntej drilled thiab nrog kev sib txuas ib ncig ntawm txhua qhov. Nws tsuas yog tsim nyog los txhim kho cov khoom siv thiab koom nrog ntau lub qhov los tsim cov kab.

Tom qab ntawd tus tuav lub roj teeb tau xau. Nyob rau tib lub sijhawm, lub hauv paus uas yuav tsev cov khoom tau luam tawm. Qhov no suav nrog plaub lub hauv paus, muaj chaw txaus nyob hauv tsev ntau yam khoom siv, qhib lub nplhaib qhib thiab muaj chaw txaus rau luam dab.

Tom qab lub hauv paus tau npaj tiav, lub nplhaib coj tau teeb tsa thiab txuas nrog kev txhawb nqa ntawm cov khoom seem. Kev txhawb nqa thiab tus tuav lub roj teeb tau tsau rau lub hauv paus nrog cov kua nplaum ua kom sov.

Kauj ruam 3: Code

Txoj cai yuav txuas ESP-01 mus rau lub wireless network thiab tom qab ntawd txuas rau lub phiaj xwm zoo nkauj thiab txheeb xyuas cov xim tam sim no. Nws mam li hloov nws cov xim rau xim ntawm txoj haujlwm zoo nkauj.

Txhawm rau ua haujlwm, yuav tsum muaj peb lub tsev qiv ntawv:

  • ThingSpeak - txhawm rau txuas rau Cheerlights project
  • ESP8266WiFi - siv ESP -01
  • Adafruit_NeoPixel - siv lub nplhaib coj

Code (koj tuaj yeem pom nws ntawm kuv tus GitHub Account)

#suav nrog

#include #include #define PixelPin 2 #define PixelNum 12 const char* ssid = "dev"; const char* password = "RatoRoeuRolha"; unsigned ntev cheerLightsChannelNumber = 1417; int ncua sij hawm = 500; String colorName = {"tsis muaj", "liab", "paj yeeb", "ntsuab", "xiav", "cyan", "dawb", "sov dawb", "qub", "ntshav", "magenta", "daj", "txiv kab ntxwv"};

// Daim ntawv qhia ntawm RGB qhov tseem ceeb rau txhua tus Cheerlight xim npe

int colorRGB [3] = {0, 0, 0, // "tsis muaj" 255, 0, 0, // "liab" 255, 192, 203, // "paj yeeb" 0, 255, 0, // "ntsuab" 0, 0, 255, // "xiav" 0, 255, 255, // "cyan", 255, 255, 255, 255, // "dawb", 255, 223, 223, // "sov dawb", 255, 223, 223, // "oldlace", 128, 0, 128, // "ntshav", 255, 0, 255, // "magenta", 255, 255, 0, // "daj", 255, 165, 0}; // "txiv kab ntxwv"}; Adafruit_NeoPixel pixels = Adafruit_NeoPixel (PixelNum, PixelPin, NEO_GRB + NEO_KHZ800); WiFiClient wclient; teeb tsa tsis muaj dab tsi () {Serial.begin (9600); WiFi.begin (ssid, password); WiFi.mode (WIFI_STA); Serial.println ("."); thaum (WiFi.status ()! = WL_CONNECTED) {ncua (500); Serial.print ("."); } Serial.println (""); Serial.print ("Ligado a"); Serial.println (ssid); Serial.print ("Xeem IP:"); Serial.println (WiFi.localIP ()); pixels.begin (); ThingSpeak.begin (wclient); } void loop () {String color = ThingSpeak.readStringField (cheerLightsChannelNumber, 1); setColor (xim); //Serial.println(xim); ncua (5000); } void setColor (String color) {rau (int iColor = 0; iColor <= 12; iColor ++) {yog (xim == colorName [iColor]) {rau (int i = 0; i <PixelNum; i ++) {

pixels.setPixelColor (i, pixels. Color (colorRGB [iColor] [0], colorRGB [iColor] [1], colorRGB [iColor] [2])); // Nruab nrab qaim xim ntsuab.

pixels.show (); // Qhov no xa qhov hloov tshiab pixel xim rau kho vajtse. } rov qab; }}}

Kauj Ruam 4: Kauj Ruam Kawg

Kauj Ruam Kawg
Kauj Ruam Kawg
Kauj Ruam Kawg
Kauj Ruam Kawg
Kauj Ruam Kawg
Kauj Ruam Kawg
Kauj Ruam Kawg
Kauj Ruam Kawg

Dab tau luam tawm ntawm Prusa i3 siv PLA pob tshab kom tso cai pom kev.

Thaum kawg lub roj teeb tau teeb tsa thiab dab raug tso.

Xa ib qho tweet nrog "#cheerlight red" hloov xim rau liab.

Pom zoo: