Orodha ya maudhui:

Saa Saa ya Saa iliyoko: Hatua 4
Saa Saa ya Saa iliyoko: Hatua 4

Video: Saa Saa ya Saa iliyoko: Hatua 4

Video: Saa Saa ya Saa iliyoko: Hatua 4
Video: АРАМ ЗАМ ЗАМ - Песни Для Детей - Развивающие Мультики 2024, Desemba
Anonim
Saa Saa Saa iliyoko
Saa Saa Saa iliyoko

Lengo

Nilitengeneza Saa hii kwa sababu nina ukanda wa LED unaoweza kushughulikiwa uliowekwa karibu na ninataka kuitumia. Ndipo nikaona chumba changu hakina Saa nzuri inayolingana na kuta zake. Kwa hivyo niliamua kutengeneza Saa ambayo inaweza kubadilisha rangi zake kulingana na hali ya watumiaji au rangi ya ukuta.

Hatua ya 1: Video ya YouTube

Image
Image

Tazama video hii ya youtube kwa maagizo kamili

Hatua ya 2: Utaratibu

Kwanza nilichukua bodi ya plywood ya inchi 24 x 15.

Kata vipande vya LED vipande vipande na ubandike kwenye ubao Halafu Baada ya kuziunganisha mimi hufunika nzima na karatasi nyeusi ya chati Kisha bandika karatasi ya thermocoal juu yake na ukata kipigo cha moto na mkataji mkali kwa sura ya maonyesho 4 ya sehemu saba pamoja na mashimo mawili katikati. Kisha nikafanya mzunguko wangu uwe tayari kwa kutumia mchoro wa mizunguko uliopewa hapa chini

na kubandika hii nyuma ya bodi. Niliamuru pia pcb ya kawaida kwa hiyo kutoka https://jlcpcb.com wanapeana prototypes bora za pcb kwa bei ya chini kabisa kutoka china na kusafirisha ulimwenguni kwa haraka na salama. baada ya kuuza vifaa vyangu vyote kwenye ubao wangu niliondoa ubao wa mkate na kurekebisha kila kitu nyuma ya ubao na kufunika sehemu ya mbele kwa kutumia karatasi nyembamba ya kufuatilia. Saa inaonekana ya kushangaza na inaongeza uzuri wa ukuta. rangi za usanifu zinaifanya iwe kamili kwa ukuta wowote.

Ikiwa unapenda mradi huu Jisajili kwenye youtube au tembelea wavuti yetu https://robocircuits.com Asante kwa kusoma!

Hatua ya 3: Kanuni

/ * Nambari imeundwa na RoboCircuits

* Tembelea Tovuti yetu https://robocircuits.com kwa usaidizi wa nambari hii * Nambari hii hutumia DS3231.h Maktaba kuipakua kutoka kwa https://robocircuits.com * Kwa Mafunzo Kamili Tazama video kwenye Kituo chetu cha YouTube https:// youtube. com / robocircuits * /

#jumuisha #jumuisha

int i = 0, j = 0, k = 150;

// Init DS3231 kwa kutumia kiolesura cha vifaa DS3231 rtc (SDA, SCL);

#ifdef _AVR_ # pamoja #endif

// Je! Ni pini ipi kwenye Arduino iliyounganishwa na NeoPixels? // Kwenye Trinket au Gemma tunashauri kubadilisha hii kuwa 1 #fafanua PIN 6

// Je, ni NeoPixels ngapi zimeunganishwa na Arduino? #fafanua NUMPIXELS 45

// Tunapoweka maktaba ya NeoPixel, tunaiambia ni saizi ngapi, na ni pini gani ya kutumia kutuma ishara. // Kumbuka kuwa kwa vipande vya zamani vya NeoPixel unaweza kuhitaji kubadilisha kigezo cha tatu - angalia strandtest // mfano kwa habari zaidi juu ya maadili yanayowezekana. Saizi za Adafruit_NeoPixel = Adafruit_NeoPixel (NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

kuchelewesha int = 500; // kuchelewa kwa nusu sekunde

kuanzisha batili () {// Hii ni kwa Trinket 5V 16MHz, unaweza kuondoa laini hizi tatu ikiwa hutumii Trinket #if defined (_AVR_ATtiny85_) ikiwa (F_CPU == 16000000) clock_prescale_set (clock_div_1); # endif // Mwisho wa nambari maalum ya trinket

saizi. anza (); // Hii inaanzisha maktaba ya NeoPixel. // Kuanzisha unganisho la serial Serial.begin (115200); // Anzisha kitu cha rtc rtc. Anza (); // Mistari ifuatayo haiwezi kutafakari kuweka tarehe na saa //rtc.setDOW (JUMATANO); // Weka Siku ya Wiki hadi JUMAPILI //rtc.setTime(12, 0, 0); // Weka wakati hadi 12:00:00 (muundo wa 24hr) // rtc.setDate (1, 1, 2014); // Weka tarehe kuwa Januari 1, 2014}

kitanzi batili () {if (digitalRead (2) == HIGH) {int a = AnalogRead (A0); int b = analog Soma (A1); int c = AnalogSoma (A2); i = ramani (a, 0, 1025, 0, 150); // Rangi ya Kijani j = ramani (b, 0, 1025, 0, 150); // Rangi ya Bluu k = ramani (c, 0, 1025, 0, 150); // Rangi Nyekundu} kingine {i = 0; j = 0; k = 150; }

// Msimbo wa Mwangaza wa Mwangaza wa (int x = 29; x <= 45; x ++) {pixels.setPixelColor (x, pixels. Color (i, j, k)); saizi. onyesha (); }

// Kuchukua Wakati Halisi kutoka kwa rtc String x = rtc.getTimeStr (); // Wakati wa kutuma Serial.println (rtc.getTimeStr ()); saa 1 = x.charAt (0); saa 2 = x.charAt (1); int min1 = x.charAt (3); int min2 = x.charAt (4); saa1 = saa1-48; saa2 = saa2-48; min1 = dakika1-48; min2 = dakika2-48;

// Wakati wa kuonyesha saa kubadili saa (saa1) {// kesi 0: sifuri (0); // kuvunja; kesi 1: moja (0); kuvunja; kesi 2: mbili (0); kuvunja; chaguo-msingi: nulll (0); kuvunja; } kubadili (hour2) {kesi 0: sifuri (7); kuvunja; kesi 1: moja (7); kuvunja; kesi 2: mbili (7); kuvunja; kesi 3: tatu (7); kuvunja; kesi 4: nne (7); kuvunja; kesi 5: tano (7); kuvunja; kesi ya 6: sita (7); kuvunja; kesi 7: saba (7); kuvunja; kesi ya 8: nane (7); kuvunja; kesi 9: tisa (7); kuvunja; chaguo-msingi: nulll (7); kuvunja; } kubadili (min1) {kesi 0: sifuri (15); kuvunja; kesi 1: moja (15); kuvunja; kesi 2: mbili (15); kuvunja; kesi 3: tatu (15); kuvunja; kesi 4: nne (15); kuvunja; kesi 5: tano (15); kuvunja; chaguo-msingi: nulll (15); kuvunja; } kubadili (min2) {kesi 0: sifuri (22); kuvunja; kesi 1: moja (22); kuvunja; kesi 2: mbili (22); kuvunja; kesi 3: tatu (22); kuvunja; kesi 4: nne (22); kuvunja; kesi 5: tano (22); kuvunja; kesi ya 6: sita (22); kuvunja; kesi 7: saba (22); kuvunja; kesi ya 8: nane (22); kuvunja; kesi 9: tisa (22); kuvunja; chaguo-msingi: nulll (22); kuvunja; } saizi.setPixelColor (14, saizi Rangi (i, j, k)); saizi. onyesha (); kuchelewesha (250); saizi.setPixelColor (14, saizi Rangi (0, 0, 0)); saizi. onyesha (); kuchelewesha (250); }

sifuri batili (int a) {saizi {setPixelColor (a + 0, saizi. Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 1, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 2, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 3, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 4, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 5, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 6, saizi Rangi (i, j, k)); saizi. onyesha (); } batili moja (int a) saizi {set.setPixelColor (a + 0, saizi. Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 1, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 2, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 3, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 4, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 5, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 6, saizi Rangi (i, j, k)); saizi. onyesha (); } batili mbili (int a) saizi {set.setPixelColor (a + 0, saizi. Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 1, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 2, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 3, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 4, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 5, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 6, saizi Rangi (0, 0, 0)); saizi. onyesha (); } batili tatu (int a) saizi {set.setPixelColor (a + 0, saizi. Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 1, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 2, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 3, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 4, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 5, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 6, saizi Rangi (i, j, k)); saizi. onyesha (); } batili nne (int a) saizi {set.setPixelColor (a + 0, saizi. Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 1, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 2, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 3, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 4, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 5, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 6, saizi Rangi (i, j, k)); saizi. onyesha (); } batili tano (int a) saizi {set.setPixelColor (a + 0, saizi. Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 1, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 2, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 3, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 4, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 5, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 6, saizi Rangi (i, j, k)); saizi. onyesha (); } batili sita (int a) saizi {set.setPixelColor (a + 0, saizi. Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 1, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 2, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 3, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 4, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 5, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 6, saizi Rangi (i, j, k)); saizi. onyesha (); } batili saba (int a) saizi {set.setPixelColor (a + 0, saizi. Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 1, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 2, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 3, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 4, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 5, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 6, saizi Rangi (i, j, k)); saizi. onyesha (); } batili nane (int a) saizi {set.setPixelColor (a + 0, saizi. Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 1, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 2, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 3, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 4, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 5, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 6, saizi Rangi (i, j, k)); saizi. onyesha (); } batili tisa (int a) saizi {set.setPixelColor (a + 0, saizi. Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 1, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 2, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 3, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 4, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 5, saizi Rangi (i, j, k)); saizi. onyesha (); saizi.setPixelColor (a + 6, saizi Rangi (i, j, k)); saizi. onyesha (); } batili nulll (int a) {pixels.setPixelColor (a + 0, pixels. Color (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 1, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 2, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 3, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 4, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 5, saizi Rangi (0, 0, 0)); saizi. onyesha (); saizi.setPixelColor (a + 6, saizi Rangi (0, 0, 0)); saizi. onyesha (); }

Hatua ya 4: Asante

tembelea

Ilipendekeza: