Button-module
KY-004 Button-module
KY-004 Button-module
Contents 1 Picture ..............................................................
Description
KY-004 Button-module
KY-004 Button-module
Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ................................................................................................................................................................... 2 4 Code example Arduino ......................................................................................................................................... 2 5 Code example Raspberry Pi ................................................................................................................................. 3
Picture
Technical data / Short description
By pressing the button, the signal circuit is switched.
Export: 16.06.2017
Copyright by Joy-IT - Published under CC BY-NC-SA 3.0
Page 22 of 214
KY-004 Button-module
Pinout
Code example Arduino
This example will light up a LED after the button is pressed. The module KY-011, KY-016 or KY-029 can be used as a LED.
int Led = 13 ;// Declaration of the LED-output pin int Sensor = 10; // Declaration of the sensor input pin int val; // Temporary variable void setup () {
pinMode (Led, OUTPUT) ; // Initialization output pin pinMode (Sensor, INPUT) ; // Initialization sens...
Similar Datasheet