Arduino tutorial Control a LED with a push Button || Tinkercad

preview_player
Показать описание
in this tutorial we will see that how can we control led with digital pin using Arduino.

Push Button and LED control with the Arduino board.
Рекомендации по теме
Комментарии
Автор

void setup()
{
pinMode(13, OUTPUT);
pinMode(2, INPUT);
}

void loop()
{
if(digitalRead(2)==1)
{
digitalWrite(13, HIGH);
delay(1000); // Wait for 1000 millisecond(s)
}
else
{
digitalWrite(13, LOW);
// Wait for 1000 millisecond(s)
}
}

prabhatpandey
visit shbcf.ru