Led (inglizcha: light-emitting diode, „yorituvchi diod ) bu yarimoʻtkazgichli yorugʻlik manbai boʻlib, tokni bevosita yorugʻlikka aylantiradi


Download 1.26 Mb.
bet1/3
Sana18.06.2023
Hajmi1.26 Mb.
#1586059
  1   2   3
Bog'liq
temirovjahongir


O‘ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI


MUHAMMAD AL-XORAZMIY NOMIDAGI
TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI
TELEKOMMUNIKATSIYA TEXNOLOGIYALARI FAKULTETI


O’RNATILGAN TIZIMLAR FANIDAN



1 – TOPSHIRIQ ISHI




O‘qituvchi: Xoldorov Shohruhmirzo
Bajardi: Temirov Jahongir
(412-20 guruh talabasi)
Toshken – 2023
Jarayonlarni controller yordamida tashkil etish



  1. Led diodlar yordamida jarayon tashkil etish



LED (inglizcha: light-emitting diode, „yorituvchi diod“) - bu yarimoʻtkazgichli yorugʻlik manbai boʻlib, tokni bevosita yorugʻlikka aylantiradi. Yarikoʻtkazgichdagi elektronlar elektron teshiklar bilan rekombinatsiya qilinganda, energiya fotonlar shaklida chiqariladi.
LEDning nominal oqimiga olib keladigan p-n o'tish joyida oldinga kuchlanish pasayishi. Anod katodga nisbatan ijobiy potentsialda bo'lishi uchun LEDga kuchlanish qo'llaniladi. Yarimo'tkazgichning kimyoviy tarkibiga, optik nurlanishning to'lqin uzunligiga qarab, ulanish joyidagi to'g'ridan-to'g'ri kuchlanish tushishi ham farqlanadi.
Amaliy qism:

  1. Led diodlar yordamida quyidagi shakldagi jarayyon tashkil etildi. Jarrayon wokwi muhitida tashkil etildi.

1 - rasm: Jarrayyon hosil bo’lgan muhitning umumiy interfeysi



  1. D astur ishga tushirilgani





2 – rasm : Dastur ishga tushurilgandagi holat

  1. Dastur kodi quyidagicha:

1) Code 1
int lampPin2 = 2; // the PWM pin number of the first lamp
int lampPin3 = 3; // the PWM pin number of the second lamp
int lampPin4 = 4; // the PWM pin number of the third lamp


void setup() {
pinMode(lampPin2, OUTPUT); // set the first lamp pin as output for PWM
pinMode(lampPin3, OUTPUT); // set the second lamp pin as output for PWM
pinMode(lampPin4, OUTPUT); // set the third lamp pin as output for PWM
analogWrite(lampPin2, 255); // set the brightness of the first lamp to maximum
analogWrite(lampPin3, 255); // set the brightness of the second lamp to maximum
analogWrite(lampPin4, 255); // set the brightness of the third lamp to maximum
}


void loop() {
// do nothing
}


2) Code 2
const int switchPin = 5; // the pin number of the switch
int lampState = LOW; // the current state of the lamp (LOW or HIGH)
int lampBrightness = 0; // the current brightness of the lamp (0 to 255)

void setup() {


pinMode(switchPin, INPUT_PULLUP); // set the switch pin as input with pull-up resistor
pinMode(2, OUTPUT); // set pin 2 as output for PWM
pinMode(3, OUTPUT); // set pin 3 as output for PWM
pinMode(4, OUTPUT); // set pin 4 as output for PWM
}

void loop() {


if (digitalRead(switchPin) == LOW) { // if the switch is pressed
if (lampState == LOW) { // if the lamp is currently off
lampState = HIGH; // turn the lamp on
analogWrite(2, lampBrightness); // set the brightness of the lamp on pin 2
analogWrite(3, lampBrightness); // set the brightness of the lamp on pin 3
analogWrite(4, lampBrightness); // set the brightness of the lamp on pin 4
} else { // if the lamp is currently on
lampState = LOW; // turn the lamp off
analogWrite(2, 0); // turn off the lamp on pin 2
analogWrite(3, 0); // turn off the lamp on pin 3
analogWrite(4, 0); // turn off the lamp on pin 4
}
}
lampBrightness = map(analogRead(A0), 0, 1023, 0, 255); // read the brightness from a potentiometer on A0
analogWrite(2, lampBrightness); // set the brightness of the lamp on pin 2
analogWrite(3, lampBrightness); // set the brightness of the lamp on pin 3
analogWrite(4, lampBrightness); // set the brightness of the lamp on pin 4
delay(100); // a small delay to avoid flicker
}

  1. Dasturga kirish va jarayyonni tekshirish uchun havola:

https://www.tinkercad.com/things/2WxOBHoTdZN




  1. Download 1.26 Mb.

    Do'stlaringiz bilan baham:
  1   2   3




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling