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


Download 480.82 Kb.
Pdf ko'rish
bet4/4
Sana01.04.2023
Hajmi480.82 Kb.
#1317381
1   2   3   4
Bog'liq
laboratoriya 3 6

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 480.82 Kb.

Do'stlaringiz bilan baham:
1   2   3   4




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