Расширенный поиск

Модуль кнопки KY-004 (монтажный модуль)

Модуль кнопки KY-004 (монтажный модуль)
92,0 руб. Товар временно отсутствует на складе
  • Версия для печати
  • Задать вопрос о товаре
  • Уведомить о поступлении
  • Скидки
    1-0 шт. за 0,0 руб.
    1 шт. за 0,0 руб.
  • Код товара: 1020
  • Вес товара,(кг):0.002
Описание товара

Arduino sample code:

Use the LED on digital pin 13, and connect the button module input to digital 3, and when button is pressed, the LED will turn on, otherwise, it will turn off.

 

int Led=13;

int buttonpin=3;

int val;

void setup()

{

pinMode(Led,OUTPUT);

pinMode(buttonpin,INPUT);

}

void loop()

{

val=digitalRead(buttonpin);

if(val==HIGH)

{

digitalWrite(Led,HIGH)

}

else

{

digitalWrite(Led,LOW)

}

}

Отзывы:
Ваш отзыв может быть первым.
Написать отзыв