The RUNCCI-YUN TS-G005 is a momentary push button switch designed for a wide range of applications. This switch is commonly used in electronic projects and commercial products for simple on/off control, user input, or as an interface for user interaction. Due to its momentary action, the switch is only active when pressed and returns to its inactive state upon release.
Pin Number | Description |
---|---|
1 | Normally Open (NO) |
2 | Common (COM) |
// Define the pin connected to the push button
const int buttonPin = 2;
// Variable for reading the push button status
int buttonState = 0;
void setup() {
// Initialize the push button pin as an input
pinMode(buttonPin, INPUT);
}
void loop() {
// Read the state of the push button value
buttonState = digitalRead(buttonPin);
// Check if the push button is pressed
// if it is, the buttonState is HIGH
if (buttonState == HIGH) {
// Turn on an LED (or perform another action)
} else {
// Turn off the LED (or stop the action)
}
}
Q: Can I use this switch with a higher voltage or current? A: No, exceeding the specified voltage or current ratings can damage the switch and lead to unsafe conditions.
Q: How can I tell if the switch is in the ON or OFF position? A: As a momentary switch, it is only ON when pressed. It returns to OFF when released.
Q: What is the lifespan of the switch? A: The lifespan depends on usage, but it is typically rated for thousands of cycles.
Remember to always follow safety guidelines when working with electronic components and consult the manufacturer's datasheet for more detailed information.