2-laboroto`riya ishi int button = 2


Download 208.81 Kb.
Sana05.01.2023
Hajmi208.81 Kb.
#1078939
Bog'liq
2-laboroto`riya ishi T


2-laboroto`riya ishi

int button = 2;

int led = 8;

void setup() {

pinMode(led, OUTPUT);

pinMode(button, INPUT);


Serial.begin(9600);

}

void loop(){



if (digitalRead(button) == HIGH) {

digitalWrite(led, HIGH);

}

else {


digitalWrite(led, LOW);

}
Serial.println(digitalRead(button));


delay(1000)


Download 208.81 Kb.

Do'stlaringiz bilan baham:




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