Push button module

Push button module
Euro 1.65 *Prices include VAT
Article codeARD151
Push button module. Suitable for Arduino or other microcontrollers.
Op voorraad / on stock
Push button module. Suitable for Arduino or other microcontrollers.

Example 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)

}

}