Sale!

2-Piece Lever Switch 2-Way 2.54 mm

Original price was: 2,56 €.Current price is: 1,97 €. Excluding VAT

The 2-position 2.54 mm lever switch is perfect for your Arduino projects. Use it to easily control 2-way devices.

Available on back-order

Domande su questo prodotto? Scrivi a Lana su WhatsApp

Category:

🎬 The product on video

Description

What it is

The slide switch 2 pieces 2.54 mm is an electronic component that allows to interrupt or restore the flow of electric current in a circuit. Each switch has two paths, allowing to control two separate circuits.

Features

  • 2 pieces
  • 2 paths
  • Dimensions: 2.54 mm

What it is for

This switch is ideal for controlling devices that require a binary action, such as lights, motors or other electronic components. It can be used in electronic projects, home automation and robotics. It is compatible with Arduino and other microcontrollers.

Tutorial: How to use Slide Switch 2 pieces

The slide switch 2 pieces is ideal for controlling devices that require a binary action, such as lights or motors. Useful for electronic and home automation projects.

What you need

  • Slide Switch 2 pieces
  • Arduino UNO or compatible
  • Power cable
  • Resistor (1kΩ)

Steps

  1. 1. Set up the Arduino programming interface.
  2. 2. Connect the switch to pin 2 of Arduino.
  3. 3. Connect a resistor between pin 2 of Arduino and GND.
  4. 4. Load the following code.
  5. 5. Test the switch.
  6. 6. Check the datasheet for further details.
  7. 7. Disconnect the programming interface.
  8. 8. Connect the switch to a real device.

Example code

void setup() {} 
void loop() { 
  int stato = digitalRead(2); 
  if (stato == HIGH) { 
    // Azione quando l'interruttore è acceso 
  } else { 
    // Azione quando l'interruttore è spento 
  } 
}

Mini project

Build an automatic lighting system. Connect an LED to pin 13 of Arduino and control the light with the switch.

Common mistakes

  • Do not connect the switch directly to VCC.
  • Make sure the switch is properly connected.
  • Do not use an analog pin for a digital switch.
  • Verify that the code is correct.

Recommended accessories

  • LED
  • Resistor (for LED)
  • Arduino UNO
  • Breadboard connector

Frequently asked questions

Can I use an Arduino nano?
Yes, the nano supports the same code.

Which resistor to use?
Use a 1kΩ resistor.

Can pin 2 be replaced with another one?
Yes, select any digital pin.

Can I use this switch to control a motor?
No, use a motor contactor switch.

Reviews

There are no reviews yet.

Be the first to review “2-Piece Lever Switch 2-Way 2.54 mm”

Your email address will not be published. Required fields are marked *