Mundarija:
Video: Atrofdagi real vaqtda soat: 4 qadam
2024 Muallif: John Day | [email protected]. Oxirgi o'zgartirilgan: 2024-01-30 13:26
Maqsad
Men bu soatni qildim, chunki menda LED tasmasi bor va men uni ishlatmoqchiman. Keyin ko'rdimki, mening xonamda devorlariga mos keladigan yaxshi soat yo'q. Shunday qilib, men foydalanuvchilarning kayfiyatiga yoki devor rangiga qarab ranglarini o'zgartiradigan soat yasashga qaror qildim.
1 -qadam: YouTube video
To'liq ko'rsatmalar uchun bu youtube videosini ko'ring
2 -qadam: protsedura
Men birinchi navbatda 24 x 15 dyuymli kontrplak taxtasini oldim.
LED tasmasini bo'laklarga bo'lib kesib, taxtaga yopishtiring, keyin lehimlangandan so'ng, men hamma narsani qora qog'ozli qog'oz bilan yopaman, ustiga termokoal varaqni yopishtiraman va termokalni to'rtta etti segmentli displey shaklidagi o'tkir pichoq bilan kesib olaman. markazida ikkita teshik. Keyin quyida keltirilgan sxemalar yordamida mening sxemamni tayyorladim
va bularning hammasini taxtaning orqasiga yopishtirdi. Men ham xuddi shunday shaxsiy kompyuterga buyurtma berdim https://jlcpcb.com saytidan, ular Xitoydan eng past narxda eng yaxshi PCB prototiplarini taqdim etishadi va butun dunyo bo'ylab tez va xavfsiz etkazib berishadi. taxtaga barcha komponentlarimni lehimlagandan so'ng, men taxtani olib tashladim va hamma narsani taxtaning orqasida va old qismini yopiq shaffof qog'ozli qog'oz yordamida tuzatdim. Soat ajoyib ko'rinadi va devorning chiroyini oshiradi. Ranglarni sozlash har qanday devorga mos keladi.
Agar sizga bu loyiha yoqsa, youtube -ga obuna bo'ling yoki https://robocircuits.com veb -saytimizga tashrif buyuring, o'qiganingiz uchun tashakkur!
3 -qadam: kod
/* Kodeks RoboCircuits tomonidan ishlab chiqilgan
* Ushbu kod bo'yicha yordam olish uchun https://robocircuits.com veb -saytimizga tashrif buyuring * Bu kod DS3231.h kutubxonasidan foydalanadi, uni https://robocircuits.com saytidan yuklab oling * Videoni to'liq o'qish uchun YouTube kanalimizda https:// youtube da ko'ring. com/robocircuits */
#qo'shing #qo'shing
int i = 0, j = 0, k = 150;
// DS3231 rtc (SDA, SCL) apparat interfeysi yordamida DS3231 -ni ishga tushiring;
#ifdef _AVR_ ##endifni qo'shing
// Arduino -dagi qaysi pin NeoPixel -ga ulangan? // Trinket yoki Gemma -da biz buni 1 ta aniqlangan PIN 6 ga o'zgartirishni taklif qilamiz
// Arduino -ga nechta NeoPixel biriktirilgan? #NUMPIXELS 45 ni aniqlang
// NeoPixel kutubxonasini o'rnatganimizda, biz unga qancha piksel va signal yuborish uchun qaysi pinni ishlatish kerakligini aytamiz. // E'tibor bering, eski NeoPixel chiziqlar uchun uchinchi parametrni o'zgartirish kerak bo'lishi mumkin-mumkin bo'lgan qiymatlar haqida qo'shimcha ma'lumot olish uchun strandtest // misolini ko'ring. Adafruit_NeoPixel piksellari = Adafruit_NeoPixel (NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
int kechikish vaqti = 500; // yarim soniya kechiktirish
void setup () {// Bu Trinket 5V 16MHz uchun, agar siz Trinket #if (_AVR_ATtiny85_) dan foydalanmasangiz, bu uchta qatorni olib tashlashingiz mumkin, agar (F_CPU == 16000000) clock_prescale_set (clock_div_1); #endif // Trinketning maxsus kodining oxiri
piksel.begin (); // Bu NeoPixel kutubxonasini ishga tushiradi. // Serial.begin (115200) ketma -ket ulanishni sozlash; // rtc ob'ektini ishga tushiring rtc.begin (); // Sana va vaqtni belgilash uchun quyidagi satrlarga izoh berilmasligi mumkin //rtc.setDOW(WEDNESDAY); // Haftaning kunini yakshanba kuniga belgilang //rtc.setTime(12, 0, 0); // Vaqtni 12:00:00 ga o'rnating (24 soatlik format) //rtc.setDate(1, 1, 2014); // Sanani 2014 yil 1 yanvarga belgilang}
void loop () {if (digitalRead (2) == HIGH) {int a = analogRead (A0); int b = analogRead (A1); int c = analogRead (A2); i = xarita (a, 0, 1025, 0, 150); // Yashil rang j = xarita (b, 0, 1025, 0, 150); // Moviy rang k = xarita (c, 0, 1025, 0, 150); // Qizil rang} boshqa {i = 0; j = 0; k = 150; }
// Orqa yorug'lik uchun kod (int x = 29; x <= 45; x ++) {piksel.setPixelColor (x, piksel. Color (i, j, k)); piksel.show (); }
// rtc String x = rtc.getTimeStr () dan real vaqtni olish; // Serial.println (rtc.getTimeStr ()) vaqtini yuborish; int hour1 = x.charAt (0); int hour2 = x.charAt (1); int min1 = x.charAt (3); int min2 = x.charAt (4); soat1 = soat1-48; soat2 = soat2-48; min1 = min1-48; min2 = min2-48;
// Soat tugmachasida vaqtni ko'rsatish (hour1) {// 0 holat: nol (0); // tanaffus; 1 -holat: bitta (0); tanaffus; 2 -holat: ikkita (0); tanaffus; standart: nulll (0); tanaffus; } switch (hour2) {0 holat: nol (7); tanaffus; 1 -holat: bitta (7); tanaffus; 2 -holat: ikkita (7); tanaffus; 3 -holat: uchta (7); tanaffus; ish 4: to'rt (7); tanaffus; ish 5: besh (7); tanaffus; ish 6: olti (7); tanaffus; ish 7: etti (7); tanaffus; ish 8: sakkiz (7); tanaffus; ish 9: to'qqiz (7); tanaffus; standart: nulll (7); tanaffus; } switch (min1) {0 holat: nol (15); tanaffus; 1 -holat: bitta (15); tanaffus; 2 -holat: ikkita (15); tanaffus; 3 -holat: uchta (15); tanaffus; ish 4: to'rt (15); tanaffus; ish 5: besh (15); tanaffus; standart: nulll (15); tanaffus; } switch (min2) {holat 0: nol (22); tanaffus; 1 -holat: bitta (22); tanaffus; 2 -holat: ikkita (22); tanaffus; 3 -holat: uchta (22); tanaffus; ish 4: to'rt (22); tanaffus; ish 5: besh (22); tanaffus; ish 6: olti (22); tanaffus; ish 7: etti (22); tanaffus; ish 8: sakkiz (22); tanaffus; ish 9: to'qqiz (22); tanaffus; standart: nulll (22); tanaffus; } piksel.setPixelColor (14, piksel. Color (i, j, k)); piksel.show (); kechikish (250); piksel.setPixelColor (14, piksel. Color (0, 0, 0)); piksel.show (); kechikish (250); }
bo'sh nol (int a) {piksel.setPixelColor (a+0, piksellar. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+1, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+2, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+3, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+4, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+5, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+6, piksel. Color (i, j, k)); piksel.show (); } void one (int a) {piksel.setPixelColor (a+0, piksellar. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+1, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+2, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+3, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+4, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+5, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+6, piksel. Color (i, j, k)); piksel.show (); } void two (int a) {piksel.setPixelColor (a+0, piksellar. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+1, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+2, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+3, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+4, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+5, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+6, piksel. Color (0, 0, 0)); piksel.show (); } bekor uchta (int a) {piksel.setPixelColor (a+0, piksellar. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+1, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+2, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+3, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+4, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+5, piksellar. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+6, piksel. Color (i, j, k)); piksel.show (); } to'rtta bo'sh joy (int a) {piksel.setPixelColor (a+0, piksellar. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+1, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+2, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+3, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+4, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+5, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+6, piksel. Color (i, j, k)); piksel.show (); } bo'sh besh (int a) {piksel.setPixelColor (a+0, piksellar. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+1, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+2, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+3, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+4, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+5, piksellar. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+6, piksel. Color (i, j, k)); piksel.show (); } void olti (int a) {piksel.setPixelColor (a+0, piksellar. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+1, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+2, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+3, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+4, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+5, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+6, piksel. Color (i, j, k)); piksel.show (); } yettita bo'sh joy (int a) {piksel.setPixelColor (a+0, piksellar. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+1, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+2, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+3, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+4, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+5, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+6, piksel. Color (i, j, k)); piksel.show (); } void sakkiz (int a) {piksel.setPixelColor (a+0, piksellar. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+1, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+2, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+3, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+4, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+5, piksellar. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+6, piksel. Color (i, j, k)); piksel.show (); } void to'qqiz (int a) {piksel.setPixelColor (a+0, piksellar. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+1, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+2, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+3, piksel. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+4, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+5, piksellar. Color (i, j, k)); piksel.show (); piksel.setPixelColor (a+6, piksel. Color (i, j, k)); piksel.show (); } void nulll (int a) {piksel.setPixelColor (a+0, piksellar. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+1, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+2, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+3, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+4, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+5, piksel. Color (0, 0, 0)); piksel.show (); piksel.setPixelColor (a+6, piksel. Color (0, 0, 0)); piksel.show (); }
4 -qadam: Rahmat
robocircuits.com saytiga tashrif buyuring
Tavsiya:
Haqiqiy vaqtda soat modulidan qanday foydalanish kerak (DS3231): 5 qadam
Haqiqiy vaqtda soat modulidan qanday foydalanish kerak (DS3231): DS3231-bu past haroratli, juda aniq I2C real vaqtda soat (RTC), haroratni kompensatsiyalangan kristalli osilator (TCXO) va kristalli. Qurilma batareya quvvatini o'z ichiga oladi va uning asosiy quvvati quvvat olganda vaqtni aniq saqlaydi
HC-05 orqali Arduino-dan Android-da real vaqtda grafikni chizish: 3 qadam
HC-05 orqali Arduino-dan Android-da real vaqtda grafikni chizish: Salom, mana bu erda Arduino kabi mikro-kontrollerdan real vaqtda qiymatlar grafigini tuzish bo'yicha qo'llanma. U HC-05 kabi Bluetooth modulidan foydalanadi, bu ma'lumotlar uzatish va qabul qilish uchun xabar almashish qurilmasi vazifasini bajaradi
Arduino bilan DS1307 va DS3231 real vaqtda soat modullaridan foydalanish: 3 qadam
Arduino bilan DS1307 va DS3231 real vaqtda soat modullaridan foydalanish: Biz har xil manbalardan DS1307 va DS3231 real vaqtda soat modullarini Arduino-dan qanday ishlatish bo'yicha so'rovlarni olamiz-shuning uchun bu ulardan foydalanish bo'yicha ikki qismli darslikning birinchisi. Bu Arduino qo'llanmasi uchun bizda ikkita real vaqtda soat moduli bor
DS1307 Arduino bilan real vaqtda soat RTC: 4 qadam
DS1307 Arduino bilan Real Time CTC RTC: Bu Qo'llanma, Biz Real Time Clock haqida bilib olamiz (RTC) va qanday Arduino & Haqiqiy vaqt soati IC DS1307 vaqt qurilmasi sifatida yig'ilgan. Haqiqiy vaqt soati (RTC) vaqtni kuzatish va taqvimni saqlash uchun ishlatiladi. RTCdan foydalanish uchun
NODEMCU Lua ESP8266 real vaqtda soat (RTC) va EEPROM bilan: 7 qadam
NODEMCU Lua ESP8266 Real vaqt soati (RTC) va EEPROM bilan: Ma'lumotlar jurnalini saqlamoqchi bo'lsangiz, to'g'ri vaqtni olish juda muhimdir. Vaqtni Internetdagi manbalardan olishning turli usullari mavjud. Siz nima uchun vaqt ajratish uchun ESP8266 -dan foydalanmasligingizni so'rashingiz mumkin. Siz qila olasiz, uning o'z ichki RTC (Real Time