O‘ZBEKISTON RESPUBLIKASI
RAQAMLI TEXNOLOGIYALARI VAZIRLIGI
MUHAMMAD AL-XORAZMIY NOMIDAGI
TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI
“O‘rnatilgan tizimlar”
fanidan
LABORATORIYA
TOPSHIRIQ №1
Bajardi: 415 -guruh talabasi
Muhammadov Og’abek
Qabul qildi: Jurayev D.B.
Toshkent 2023
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.
Serial'>Potentsiometr yordamida jarayon tashkil etildi(Wokwida).
Dastur kodlari
int y ;
void setup() {
Serial.begin(9600);
pinMode(12 , OUTPUT); // lampa 1
pinMode(11 , OUTPUT); // lampa 2
pinMode(10 , OUTPUT); // lampa 3
pinMode(9 , OUTPUT); // lampa 4
pinMode(8 , OUTPUT); // lampa 5
pinMode(2 , INPUT_PULLUP); // tugma
pinMode(3 , INPUT_PULLUP); // tugma
pinMode(4 , INPUT_PULLUP); // tugma
}
void loop() {
int x = digitalRead(2);
int a = digitalRead(3);
int z = digitalRead(4);
if(x == 0)
{
y++ ;
delay(200);
}
Serial.println(y);
if(a == 0)
{
y=y+2 ;
delay(200);
}
Serial.println(y);
if(z == 0)
{
y=y++ ;
delay(200);
}
Serial.println(y);
if(y == 1)
{
digitalWrite(12 , HIGH);
digitalWrite(11 , LOW);
digitalWrite(10 , LOW);
digitalWrite(9 , LOW);
digitalWrite(8 , LOW);
}
else if( y == 2)
{
digitalWrite(12 , HIGH);
digitalWrite(11 , HIGH);
digitalWrite(10 , LOW);
digitalWrite(9 , LOW);
digitalWrite(8 , LOW);
}
else if( y == 3)
{
digitalWrite(12 , HIGH);
digitalWrite(11 , HIGH);
digitalWrite(10 , HIGH);
digitalWrite(9 , LOW);
digitalWrite(8 , LOW);
}
else if( y == 4)
{
digitalWrite(12 , HIGH);
digitalWrite(11 , HIGH);
digitalWrite(10 , HIGH);
digitalWrite(9 , HIGH);
digitalWrite(8 , LOW);
}
else if( y == 5)
{
digitalWrite(12 , HIGH);
digitalWrite(11 , HIGH);
digitalWrite(10 , HIGH);
digitalWrite(9 , HIGH);
digitalWrite(8 , HIGH);
}
else if( y == 6)
{
digitalWrite(12 , HIGH);
digitalWrite(11 , HIGH);
digitalWrite(10 , HIGH);
digitalWrite(9 , HIGH);
digitalWrite(8 , HIGH);
}
else if( y == 7)
{
digitalWrite(12 , HIGH);
digitalWrite(11 , HIGH);
digitalWrite(10 , HIGH);
digitalWrite(9 , HIGH);
digitalWrite(8 , LOW);
}
else if( y == 8)
{
digitalWrite(12 , HIGH);
digitalWrite(11 , HIGH);
digitalWrite(10 , HIGH);
digitalWrite(9 , LOW);
digitalWrite(8 , LOW);
}
else if( y == 9)
{
digitalWrite(12 , HIGH);
digitalWrite(11 , HIGH);
digitalWrite(10 , LOW);
digitalWrite(9 , LOW);
digitalWrite(8 , LOW);
}
else if( y == 10)
{
digitalWrite(12 , HIGH);
digitalWrite(11 , LOW);
digitalWrite(10 , LOW);
digitalWrite(9 , LOW);
digitalWrite(8 , LOW);
}
else if( y == 11)
{
digitalWrite(12 , LOW);
digitalWrite(11 , LOW);
digitalWrite(10 , LOW);
digitalWrite(9 , LOW);
digitalWrite(8 , LOW);
}
}
Do'stlaringiz bilan baham: |