Interfacing Joystick module with evive

About This Tutorial
In this tutorial we will interface joystick module with evive and we will move rectangular box drawn on TFT display according to the movement on joystick module
Tutorial Info

Introduction

The joystick is a device  that translates your hand movement in to electrical signal,And the movements are converted by computational unit in to entirely mathematical, in other words joystick translates entirely physical movement.The joystick in the picture is nothing but two potentiometer that allow us to measure the movement of stick in 2-D. Potentiometer are basically variable resistor , In joystick module Potentiometers act as  sensor providing  us with a variable voltage depending on the rotation of the device around its shafts.

Pin description

joystick module have 5 pins  ( 2- power supply pins and 3- signal pins)

  • VCC
  • GND
  • VRX ( signal pin for x direction )
  • VRY ( signal pin for y direction )
  • SW   ( signal pin for Switch button )

Analog output obtained for each direction

          Direction                         Analog output  (Between 0 to 1023)
             REST

                                             X = 530          Y = 518                                       

              UP                                             X = 1023        Y = 518
           DOWN                                             X = 0               Y = 518
          RIGHT                                             X = 530           Y = 1023
           LEFT                                             X = 530           Y = 0

 

Circuit diagram

  • Connect “VCC” of joystick module to “VCC” of evive 
  • Connect “GND” of joystick module to “GND” of evive 
  • Connect “VRX” of joystick module to analog pin “A0” of evive
  • Connect “VRY” of joystick module to analog pin “A1” of evive

Code

we have divided code in to two parts 

  • 1st part of code will print analog output value for each direction on serial monitor , this analog output values will be used in second part of code to move block 
  • 2nd part of code will move block drawn on tft display according to the direction in which stick is moved

 

Expected result

 

 

 

 

 

 

 

This helped
This didn't help
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
How to interface Water Flow sensor with evive
In this tutorial, we will discuss how to interface water flow sensor with evive. How water flow rate, current water flowing and output water changes? The water flow rate in liters per hour, current water flowing and output water flowing data flowed since starting is displayed on the screen. All the answers are given in this tutorial.LET'S BEGIN...
All articles loaded
No more articles to load
Featured Projects
Robotic-Arm-Bartender
DIY Robotic Arm Bartender

This project will show you how to make your own robotic arm bartender that will make you a star host!

All articles loaded
No more articles to load
Close Menu
×

Cart