How to use evive’s Slide Switch

About This Tutorial
This tutorial discusses different types of switches based on their pole and throw, what are slide switches, and a simple Arduino IDE sketch to display the state of evive’s slide switch on the TFT screen.
Tutorial Info

Components Required

ImageComponentQuantityAvailable in Kit
evive1
USB A-B Cable1

Introduction

While learning about switches, there are two important concepts that one should look into:

  • Pole: The number of poles on a switch defines how many separate circuits the switch can control. E.g. switch with one pole, can control only one single circuit.
  • Throw: A switch’s throw-count defines how many different positions each of the switch’s poles can be connected to. E.g. if a switch has two throws, each circuit (pole) in the switch can be connected to one of two terminals.

Switches are commonly are defined as single-pole, single-throw, such as a tactile switch, and single-pole, double-throw, such as a slide switch.

Single-Pole, Single-Throw (SPST)

This is the simplest switch. It has one output and one input. The switch will either be closed or completely disconnected. SPST switches are perfect for on-off switching. They’re also a very common form of momentary switches. SPST switches require two terminals only.

Single-Pole, Double-Throw (SPDT)

SPDTs have three terminals: one common pin and two pins which for connection to the common.

evive has two inbuilt 3-way slide switches. Slide switch 1 is connected to Arduino pins 40 and 41, both active high. This means that when the switch is slid up, pin 40 is high. When it slides down, pin 41 is high while both are low when the switch is in the middle. Slide switch 2 is connected to pins 42 and 43, and works in a similar manner as slide switch 1.

evive Slide Switch

Example: Displaying the state of evive’s Slide Switch on TFT

In this example we will read the state of evive’s slide switch 1 and display it on the TFT Screen.

Flow Chart

Below is the flow chart on which the sketch will be based:

 

 

Arduino IDE Sketch

Below is the sketch:

 

Share this Tutorial
Share on facebook
Facebook
Share on twitter
Twitter
Share on google
Google+
Share on pinterest
Pinterest
Share on reddit
Reddit
Share on print
Print
Related Projects & Tutorials
Interfacing Relay with evive
This tutorial explains interfacing of a relay module with evive for controlling high power circuits like AC bulb with help of evive.
All articles loaded
No more articles to load
Featured Projects
Space-Battle-Game on Scratch
Space Battle

This project will show you how to make a cool space battle game on your own in PictoBlox (Scratch-based programming) and play using your Smartphone!

All articles loaded
No more articles to load

Leave a Reply

Close Menu
×

Cart