Laboratoriya ishi № ledni Arduino yordamida yoqish va o‘chirish. Laboratoriyaning maqsadi


Download 0.93 Mb.
bet3/3
Sana10.11.2023
Hajmi0.93 Mb.
#1761370
1   2   3
Bog'liq
Laboratoriya ishi № ledni Arduino yordamida yoqish va o‘chirish.

Arduinoga ulanish sxemasi:

6-laboratoriya ishi knopka yordamida svetofor harakati boshqarish.

Kod qismi:
int button_pin = 2;
void setup()
{
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(button_pin, INPUT);
}

void loop()


{
digitalWrite(11, HIGH);
digitalWrite(12, LOW);
digitalWrite(13, LOW);
digitalWrite(9, HIGH);
digitalWrite(10, LOW);
delay(3000);
digitalWrite(11, LOW);
digitalWrite(12, HIGH);
digitalWrite(13, LOW);
digitalWrite(9, LOW);
digitalWrite(10, HIGH);
delay(1000);
digitalWrite(11, LOW);
digitalWrite(12, LOW);
digitalWrite(13, HIGH);
digitalWrite(10, LOW);
delay(3000);
}


Xulosa: Men bu laboratoriya ishida svetofor harakatini kuzatib va uni knopka yordamida harakatini o’zgartirib boshqardim.
Download 0.93 Mb.

Do'stlaringiz bilan baham:
1   2   3




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