2-LABORATORIYA ISHI
Mavzu: Yorug’lik diodi. Arduino yordamida yorug’lik diodini o’chirib yoqish
26-variant
Laboratoriyani bajarish uchun uslubiy qo’llanmani dasturini bajarib amaliyotda qo’llaymiz
int ledPin=13;
void setup()
{
pinMode(ledPin, OUTPUT);
}
void loop()
{
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(1000);
}
Kodni Proteus programmasida sxemasini tushiramiz
O’zimizga berilgan variantni Arduino programmasida bajarib tekshirib ko’ramiz.
int ledPin=(4,7,6);
void setup()
{
pinMode(4,OUTPUT);
pinMode(7,OUTPUT);
pinMode(6,OUTPUT);
}
void loop() {
delay(1000);
digitalWrite(4,HIGH);
digitalWrite(7,HIGH);
digitalWrite(6,HIGH);
delay(1000);
digitalWrite(4,LOW);
digitalWrite(7,LOW);
digitalWrite(6,LOW);
}
Kodni Proteus programmasida sxemasini tushiramiz
-
Do'stlaringiz bilan baham: |