Put your setup code here, to run once: pinMode(red, output)


Download 0.62 Mb.
Sana21.09.2023
Hajmi0.62 Mb.
#1684130

Svetadiod
Svetadiodlar orqali juda ko’p
Ishlarni oAlib borish mumkun
Xozirgi kunda juda ko’p javxalarda
Foydalanayotgan ko’rgazmalik jarayonlar
shaxarlarni ko’rkini oshirib turgan
svetadiodlarni ko’rishimiz mumkun .
Xo’sh ushbu svetadiodlarni
qanday boshqaramiz.
int red = 9;
void setup() {
// put your setup code here, to run once:
pinMode(red, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(red, HIGH);
delay(8000);
digitalWrite(red, LOW);
delay(2000);
}
Arduinoga Svetadiodlarni ulash.
Kod qismi
void loop()
{
digitalWrite(red, HIGH);
delay(5000);
 digitalWrite(red, LOW);
 digitalWrite(yellow, HIGH);
 delay(1000);
digitalWrite(yellow, LOW);
 digitalWrite(green, HIGH);
 delay(5000);
 digitalWrite(green, LOW);
 digitalWrite(yellow, HIGH);
 delay(2000);
 digitalWrite(yellow, LOW);
}



int red = 2;
int yellow = 3;
int green = 4;
void setup()
{
pinMode(red, OUTPUT);
pinMode(yellow, OUTPUT);
pinMode(green, OUTPUT);
}
Download 0.62 Mb.

Do'stlaringiz bilan baham:




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