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


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

3 – rasm. Jarayyonni sxema ko’rinishi
Dasturni ishga tushurish va tekshirish uchun havola:
Tincercat email: temirovjahongir2809@gmail.com
https://www.tinkercad.com/things/8nnITUvZ6ql

  1. Potentsiometr yordamida jarayon tashkil etish

Potansiyometr - sozlanishi kuchlanish bo'luvchisini tashkil etuvchi toymasin yoki aylanadigan kontaktli uch terminalli rezistor. Agar faqat ikkita terminal, bir uchi va artgich ishlatilsa, u o'zgaruvchan qarshilik yoki reostat vazifasini bajaradi.
Potansiyometr deb ataladigan o'lchov vositasi, asosan, elektr potentsialini (kuchlanishni) o'lchash uchun ishlatiladigan kuchlanish bo'luvchidir; komponent bir xil printsipning amalga oshirilishi, shuning uchun uning nomi.
Potansiyometrlar odatda elektr qurilmalarini boshqarish uchun ishlatiladi, masalan, audio uskunalardagi ovoz balandligini boshqarish. Mexanizm bilan ishlaydigan potentsiometrlar joylashuv o'tkazgichlari sifatida ishlatilishi mumkin, masalan, joystikda. Potansiyometrlar sezilarli quvvatni (bir vattdan ortiq) bevosita nazorat qilish uchun kamdan-kam qo'llaniladi, chunki potansiyometrda yo'qolgan quvvat boshqariladigan yukdagi quvvat bilan taqqoslanishi mumkin.
Amaliy qism:

  1. Potentsiometr yordamida jarayon tashkil etildi. Jarayyon Tincercat muhitida tashkil qilindi.





1 – rasm: Jarayyon tashkil qilingan muhitning umumiy ko’rinishi


2 – rasm: Ishlash jarayyonidan

  1. Dasturning kodi quyidagicha yozilgan:

int led = 11; // led connected to 11th port
int button = 7;// button connected to 7th port
int pot =0;// potentiometer connected to A0


int potValue;
int buttonStatus = 0;
int ledStatus = 0;


void setup()
{
pinMode(led, OUTPUT);// led set to output
pinMode(button,INPUT);//button set to input
Serial.begin(9600);
digitalWrite(led, LOW);// led set to off mode
}


void loop()
{
buttonStatus = digitalRead(button); //reads the value from the button
delay(100); // wait 10 milliseconds
if(buttonStatus == 1) // if you pressed the button
{
if(ledStatus == 0) // if led status is in off mode
{
ledStatus = 1;// make led status is on mode
}
else
{
digitalWrite(led,LOW);
ledStatus = 0;
}
}
if(ledStatus == 1)//if led status is in on mode
{
potValue = analogRead(A0)*10;//The potentiometer value and analog readout were equaled.
//multiplied by 10 to convert to seconds
Serial.println(potValue/1000);//divided by 1000 so that the value given on the serial monitor is in seconds.
digitalWrite(led, HIGH);// led turns on
delay(potValue);//The led stays on for as many seconds as the pot value.
digitalWrite(led, LOW);// led turns off
delay(potValue);//The led stays off for as many seconds as the pot value.
}
}




3 – rasm. Jarayyonni sxema ko’rinishi

Dasturni ishga tushurish va tekshirish uchun havola:


Tincercat email: temirovjahongir2809@gmail.com
https://www.tinkercad.com/things/5orv9BsJBD6


XULOSA
Bu ishdan Arduionoda lampa ni, tugma va potensiometr bilan ulash va yoqishni o’rgandim
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