Tactile Switch

June 2, 2017

Introduction

The two tactile switches are connected to Arduino pins 38 and 39, both active high. This means that the pins are at +5V when the switch is pressed, and at 0V (Ground) otherwise.

evive Tactile Switch Pushbuttons

evive Notes Icon
Note that pins 38, 39 are pulled low, i.e. they will be at 0V (and not floating) when the switch is not pressed.

Programming in Arduino IDE

The test code for the tactile switch is given below:

Programming in PictoBlox

To get the state of the tactile switch, you can use Tactile Switch () pressed block. This block can be found under evive extension. The switch whose state you want to check can be chosen from the drop-down on this block. It is a Boolean block which returns “TRUE” if the switch is pressed and “False” if the switch is not pressed.

tactile switch pressed

Example

  • Rotating the sprite if the tactile switch 1 is pressed.

tactile switch example

Share this Documentation
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 Tutorials & Projects
evive-brain

Interfacing evive with PictoBlox

This tutorial discusses how to interface evive with PictoBlox, the evive palette, the two modes for writing scripts in PictoBlox, and how to upload a script to evive.

How to use a Tactile Switch with evive

This tutorial discusses what are switches, types of switches, pull-up and pull-down resistors, and how to control the pin 13 LED on evive using a tactile switch with the help of an Arduino IDE sketch.
tactile switch pressed

tactile switch () pressed?

evive has two tactile switches; this block checks if either of them is pressed. The switch whose state you want to check can be chosen from the drop-down menu on this block. It returns “true” if the switch is pressed and “false” if the switch is not pressed.
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