Menu
-
MenuBack
-
Menu
-
Arduino & Raspberry & Micro:bit
-
-
-
-
-
Controller Boards
-
-
-
Batteries
-
Components & TOOLS
-
-
e-Textil
-
-
-
Interruptores & Botões
-
-
-
Sound and Audio
-
-
-
Comunication & Smart Home
-
-
LCD + Matrix + Keypad
-
-
Power Sources and Renewable Energy
-
-
-
RENEWABLE ENERGY
-
-
-
3D Printing & DRONES
-
-
Informática
-
-
Informática
-
-
-
Motors and Relays
-
-
Oficina & Equipamentos
-
-
Oficina & Equipamentos
- Cable ties
- Pliers and Wrenches
- Breadboards
- Drills and Milling Cutters
- Storage Boxes
- Electronics boxes
- Bench Equipment
- Tool Cases & Kits
- Heat shrink sleeve
- Multimeters
- Oscilloscope
- Screws and Spacers
- PCB Copper
- End-Sleeves
- IC Programmers
- Personal Protection
- Protoboards
- Soldering
- Spray and Conductive Paint
- DIN Rail Supports
- Others
-
-
-
ROBOTICS
-
-
Sensors
-
-
- Catalog
- New Products
- On Sale
- Tutorials
- Contact
Tact Switch PC Horizontal 6x6mm
: CEL10014
€0.15
Tax included
PCB mount 6x6mm, max. 50mA/24V, upthrow 0,5mm, activation power 1,6N.
If you have any questions on this product please feel free to contact us.
*Disclaimer: The images are merely illustrative.
If you have any questions on this product please feel free to contact us.
*Disclaimer: The images are merely illustrative.
/* Learn to use pushbutton (button switch) with Arduino - Tutorial More info and circuit schematic: http://www.ardumotive.com/arduino-tutorials/category/button Dev: Michalis Vasilakis / Date: 19/10/2014 UPDATED 2/6/2016 - LED to Arduino pin 3 and button to Arduino pin 4*/ //Constants const int buttonPin = 4; const int ledPin = 3; //Variables int buttonState = 0; int flag=0; void setup() { //Input or output? pinMode(ledPin, OUTPUT); pinMode(buttonPin, INPUT_PULLUP); } void loop(){ //Read button state (pressed or not pressed?) buttonState = digitalRead(buttonPin); //If button pressed... if (buttonState == LOW) { //...ones, turn led on! if ( flag == 0){ digitalWrite(ledPin, HIGH); flag=1; //change flag variable } //...twice, turn led off! else if ( flag == 1){ digitalWrite(ledPin, LOW); flag=0; //change flag variable again } } delay(200); //Small delay }
Download
KSM612B.png
Download (31.72k)Related products