KY-004 3 Pin Button Key Switch Sensor Module For Arduino

1.65$

Description

1. Type: KY-004 Key Switch Sensor Module
2. Size: 18mm x 10mm
3. Rated range: 50mA 12VDC
4. Contact resistance: 50mΩ max (initial)
5. Insulation Resistance: 100MΩ (minDC 250V)
6. Dielectric Strength: AC250V (50 / 60Hz for 1minute)
7. Mechanical life Electrically Life: 100,000cycles
8. Environment temperature: -25 ℃ ~ +105 ℃
9. Operating force Operating Force: 180/230 (± 20gf)
10. Heat distortion temperature: 250 ℃ -280 ℃

 

int Led = 13 ;// define LED Interface
int buttonpin = 10; // define the key switch sensor interface
int val ;// define numeric variables val
void setup() {
  pinMode(Led, OUTPUT); // define LED as output interface
  pinMode(buttonpin, INPUT); // define the key switch sensor output interface
}
void loop() {
  val = digitalRead(buttonpin); // digital interface will be assigned a value of 3 to read val
  if (val == HIGH) { // When the key switch when the sensor detects a signal, LED flashes
    digitalWrite(Led, HIGH);
  } else {
    digitalWrite(Led, LOW);
  }
}

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.