• Sxema kodi
  • Raimov Jamshid ning




    Download 0,65 Mb.
    Sana23.12.2023
    Hajmi0,65 Mb.
    #127190
    Bog'liq
    Jamshid o\'r.t 2-ish
    Antenna va radioeshittirish MUSTAQIL ISH Avazbek, 1698727132 (1), Jamshid o\'r.t 3-ish, 1-amaliy ish 25m, 1-amaliy ish (1), AMALIY ISH-1, 3-T o.t Nusratov Javohir, antenna qayta oqish last, AMALIY ISH-2, KA 2-amaliy ish, Hisoboti Amaliyot o`tash joyi, 1-amaliy dasturlash, Algoritm baza, ehtimollik 1-topshiriq

    MUHAMMAD AL-XORAZMIY NOMIDAGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI

    Raimov Jamshid ning o'rnatilgan tizimlar


    fanidan 2-topshirig’i



    1. amaliy topshiriq

    Tinkercad.com virtual laboratoriya yordamida LED (1 va 2 ta fotodiodni button va patonsiametr yordamida yoqib o‘chirish) Arduino kit yordamida yig‘ish va ishlatish.
    Sxema kodi:
    int led = 11; // led 11-portga ulangan
    int button = 7; // tugma 7-portga ulangan
    int pot = 0; // potentsiometr A0-portga ulangan

    int potValue;


    int buttonStatus = 0;
    int ledStatus = 0;

    void setup()


    {
    pinMode(led, OUTPUT); // led chiqishga sozlanadi
    pinMode(button, INPUT); // tugma kiritishga sozlanadi
    Serial.begin(9600);
    digitalWrite(led, LOW); // led o'chiq holatga qo'yiladi
    }
    void loop()
    {
    buttonStatus = digitalRead(button); // tugma qiymatini o'qiladi
    delay(100); // 10 millisekund kutamiz
    if (buttonStatus == 1) // agar siz tugmani bosgansiz
    {
    if (ledStatus == 0) // agar led holati o'chiq bo'lsa
    {
    ledStatus = 1; // led holatini yashiradi
    }
    else
    {
    digitalWrite(led, LOW);
    ledStatus = 0;
    }
    }
    if (ledStatus == 1) // agar led holati yashirilgan bo'lsa
    {
    potValue = analogRead(A0) * 10; // Potentsiometr qiymati va analog o'qim hisoblanadi.
    // sekundga aylantirish uchun 10 ga ko'paytirilgan
    Serial.println(potValue / 1000); // sekundda ko'rsatilgan qiymatni ko'rsatish uchun 1000 ga bo'lagan
    digitalWrite(led, HIGH); // led yashiriladi
    delay(potValue); // led ko'rsatilgan vaqt mobaynida turadi
    digitalWrite(led, LOW); // led o'chiriladi
    delay(potValue); // led ko'rsatilmagan vaqt mobaynida turadi
    }
    }


    Tirkercad da havolasi:


    https://www.tinkercad.com/things/6gcXq65NH04-jamshid-led-button-va-potensiometr
    Download 0,65 Mb.




    Download 0,65 Mb.