Ammo bu holda, lenta yaratilgan rangli yorug'lik effektlarini amalga oshirish imkoniyati o'tkazib yuboriladi



Yüklə 223,84 Kb.
tarix09.06.2023
ölçüsü223,84 Kb.
#127386
2-Lab O\'T Shukrullayev D


O`ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI

MUHAMMAD AL-XORAZMIY NOMIDAGI
TOSHKENT AXBOROT TEXNOLOGIYALARI
UNIVERSITETI SAMARQAND FILIALI



Fan: O’rnatilgan tizimlar
2_Laboratoriya ishi

Bajardi:Mavlonov.M


Qabul qildi:Mirsaidov B
SAMARQAND – 2021
Yorqin faqat qizil - R, yashil - G, ko'k - B yoki oq - CW rangda, qoida tariqasida, ular to'g'ridan-to'g'ri 12 V yoki 24 V kuchlanishli doimiy oqim manbaiga ulanadi RGB LED tasmasi, monoxrom kabi, shuningdek, R, G va B pinlarini bir-biriga ulash orqali doimiy quvvat manbai oqimiga ulanishi mumkin.
Ammo bu holda, lenta yaratilgan rangli yorug'lik effektlarini amalga oshirish imkoniyati o'tkazib yuboriladi. Shuning uchun, rangli LED chiziqlarni o'rnatishda, odatda, elektr ta'minoti va chiziq o'rtasidagi ochiq kontaktlarning zanglashiga olib elektron boshqaruvchi o'rnatiladi. Bu masofadan boshqarish pultidan o'rnatilgan dasturga muvofiq dinamik rejimda lentaning rangi va yorqinligini avtomatik ravishda o'zgartirish imkonini beradi.
Fotosuratda RGB LED tasmasini 220 V tarmoqqa ulash uchun elektr diagrammasi ko'rsatilgan.Quvvat manbai (adapter) 220 V o'zgaruvchan kuchlanishni 12 V to'g'ridan-to'g'ri oqim kuchlanishiga aylantiradi, u RGB kontrolleriga ikkita sim orqali beriladi, kuzatuv qutblanish. LED tasmasi belgiga muvofiq to'rtta sim orqali tekshirgichga ulangan. LED yoritgichlarini o'rnatish va ta'mirlash qulayligi uchun birliklar ulagichlar yordamida bir-biriga ulanadi.
Ulanish diagrammasi LED R G B LED SMD-5050
R G B LED tasmasini professional darajada ulash va undan ham ko'proq ta'mirlash uchun siz uning qanday ishlashini tushunishingiz va chiziqlarda ishlatiladigan LEDlarning elektr davri va pinoutini bilishingiz kerak. Quyidagi fotosuratda LED kristallarini eritish uchun bosilgan kontaktlarning zanglashiga olib bo'lgan RGB LED tasmasining bir qismi ko'rsatilgan.

Diagrammada ko'rib turganingizdek, LEDdagi kristallar bir-biriga elektr bilan bog'lanmagan. Bitta LED korpusidagi uchta rang-barang kristal triadani tashkil qiladi. Ushbu dizayn tufayli har bir kristallning yorqinligini alohida nazorat qilish orqali siz LEDning cheksiz ko'p ranglarini olishingiz mumkin. Uyali telefonlar, navigatorlar, kameralar, kompyuter monitorlari, televizorlar va boshqa ko'plab mahsulotlarning displeylari ranglarni boshqarishning ushbu printsipi asosida qurilgan.

  1. Knopka bosilganda svetodiod o’chsin , bosmaganda yonsin.




  1. Knopka bosilganda 2ta svetodiod yonsin , bosilmaganda boshqa 2ta svetodiod yonsin.

Masal kodi:
const int Tugma = 7;
const int Led1 = 13;
const int Led2 = 12;
const int Led3 = 9;
const int Led4 = 8;
int tekButton = LOW;
int prevButton = LOW;
boolean ledon = false;
void setup() {
pinMode(Tugma, INPUT);
pinMode(Led1, OUTPUT);
pinMode(Led2, OUTPUT);
pinMode(Led3, OUTPUT);
pinMode(Led4, OUTPUT);
}
void loop() {
int tekButton = digitalRead(Tugma);
if (tekButton == HIGH && prevButton == LOW) {
ledon = !ledon;
digitalWrite(Led1, !ledon);
digitalWrite(Led2, !ledon);
digitalWrite(Led3, ledon);
digitalWrite(Led4, ledon);
}
prevButton = tekButton;



  1. Knopka bosilganda 4ta svetodiod yonsin va “knopka bosildi va birinchi 4ta svetodiod yondi” , bosilmaganda boshqa 4ta svetodiod yonsin va “knopka bosilmagan va keyingi 4ta svetodiod yondi” degan yozuv monitor portga chiqsin.

Masala kodi:
const int Tugma = 7;
const int Led1 = 13;
const int Led2 = 12;
const int Led3 = 9;
const int Led4 = 8;

boolean ledon = false;


void setup() {
pinMode(Tugma, INPUT);
pinMode(Led1, OUTPUT);
pinMode(Led2, OUTPUT);
pinMode(Led3, OUTPUT);
pinMode(Led4, OUTPUT);
}
void loop() {
ledon = digitalRead(Tugma);
digitalWrite(Led1, !ledon);
digitalWrite(Led2, !ledon);
digitalWrite(Led3, ledon);
digitalWrite(Led4, ledon);
}

4. Knopka bosib turilganda svetadiod yonib-o’chib


ishlab tursin. Qo’yvorilganda ishlashdan to’xtasin.
Masala kodi:
const int Tugma = 7;
const int Lamp = 13;
void setup() {
pinMode(Tugma, INPUT);
pinMode(Lamp, OUTPUT);
}
void loop() {
while(!digitalRead(Tugma))
{
digitalWrite(Lamp, HIGH);
delay(200);
digitalWrite(Lamp, LOW);
delay(200);
}
}

  1. Knopka bosib turilganda 3ta svetadiod ketma-ket yonib-o’chib ishlab tursin. Qo’yvorilganda o’chsin.

Masala kodi:
const int Tugma = 7;
const int Led1 = 13;
const int Led2 = 12;
const int Led3 = 11;
void setup() {
pinMode(Tugma, INPUT);
pinMode(Led1, OUTPUT);
pinMode(Led2, OUTPUT);
pinMode(Led3, OUTPUT);
}
void loop() {
if(digitalRead(Tugma))
{
digitalWrite(Led1, LOW);
digitalWrite(Led2, LOW);
digitalWrite(Led3, LOW);
}
while(!digitalRead(Tugma) == HIGH)
{
digitalWrite(Led1, HIGH);
digitalWrite(Led2, LOW);
digitalWrite(Led3, LOW);
delay(300);
digitalWrite(Led1, LOW);
digitalWrite(Led2, HIGH);
digitalWrite(Led3, LOW);
delay(300);
digitalWrite(Led1, LOW);
digitalWrite(Led2, LOW);
digitalWrite(Led3, HIGH);
delay(300);
digitalWrite(Led1, LOW);
digitalWrite(Led2, HIGH);
digitalWrite(Led3, LOW);
delay(300);
}
}
6.Knopka bosib turilganda 5ta svetadiod ketma-ket yonib-o’chib ishlab tursin. Qo’yvorilganda ishlash tezligi2 marta kamaygan holda sekin yonib-o’chishda davom etsin.

const int Tugma = 7;


const int led1 = 11;
const int led2 = 12;
const int led3 = 13;
const int led4 = 10;
const int led5 = 9;

int tekButton = LOW;


int prevButton = LOW;
boolean ledon = false;

void setup() {


pinMode(Tugma, INPUT);
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led5, OUTPUT);
}
void loop() {
int ledon = digitalRead(Tugma);
int time = 0;
if(ledon){time = 1000;}else{time=500;}
digitalWrite(led1, HIGH);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(led5, LOW);
delay(time);
if(ledon){time = 1000;}else{time=500;}
digitalWrite(led1, LOW);
digitalWrite(led2, HIGH);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(led5, LOW);
delay(time);
if(ledon){time = 1000;}else{time=500;}
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, HIGH);
digitalWrite(led4, LOW);
digitalWrite(led5, LOW);
delay(time);
if(ledon){time = 1000;}else{time=500;}
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, HIGH);
digitalWrite(led5, LOW);
delay(time);
if(ledon){time = 1000;}else{time=500;}
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(led5, HIGH);
if(ledon){time = 1000;}else{time=500;}
delay(time);
}

Yüklə 223,84 Kb.

Dostları ilə paylaş:




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin