JoyStick Controlled Relay Board
Updated Jul 2.2021
Joystick with Arduino simply by
controling four Channel relay Board as per the movement ef the
Joystick We have placed 4relays in the such away that repre
the drection of thejoyetick shart movernent, This joystick algo ha
push button which canbe
leftidie
ed for various other purposes or can be
The fist thing that comes
‘the game controler Yes, ts exactly the same and can be used for
in eur mind istening to the word Joysticks
gaming purpose. Apart From gaming. ithas many other applications
ioe, The ovetiekis nothing but @ combination oF Wo
Potentiometers forXand ¥ plane respectively Itveade the voltage.
‘through the potentiometer and gives analog value tothe Arduino, and
the analog value changes as we move the joystick shaft (which =
DIY eteowo
simply the potentiometer pointer)
Circuit Diagram
+ Arduino UNO
+ PS2.Jaystick Module Breakout Senzor
+ AGhannalReley Boaresoystick
onsiog oysticks on PS2 PlayStation 2) contrallere DirectionalOVERVIEW
+ Dimensions: 4027.15 (LAW) mm,
Weight: 10gm (without Hat)
+ 254mm pininterfoce leads
Operating Voltage: Sv
+ Long service fe and stable performance
+ Stondardinterface and ele tenc bulding biocks
+ Widelyuse in Avduine OY proects
Appeations
“LAs square wave signal generator which generates 9 square wave
signal
2.To provide a signal tothe stepping motor ever
3. Adustable pulse generation for chip use
4 Produce variable pulse signa, the contro related cicur (PWM
slimming. speed)
‘Subscibe and Download code
Installing the Arduino Library
No specialLibrary require for this project
Testing of Joystick Arduno code
intxPin
7
intyPin
o
Inthuttonbin=2
Intx@esiton =O
intyPesition =0
Intbuttonstate= 0,
void setup
‘niaize seal communieations 21 9600 ps
‘Sriabegin(9600),
pinMode(ePi INPUT)
pinMode(yPin INPUT):
‘Hectivate pul up resitor onthe push-button pin
pinMode(buttenPin, INPUT _PULLUP):pnMade(button, NPUT_PULLUP)
{For versions prt to raano 101
1 pinModefoutionPNPUT)
1 dahotvteuttonPin GH)
)
veonp0 (
sPositon = nalagRead(iPa)
Positon = nalagResd(yPn)
buttonState=agtaReadouttorPi
Seta print(X)
SenalprntiaPesition:
Seviatprintt1¥
SeriatprintyPosition).
Seriatprint¢ | Button 7
Seriatprintnguttonstate)
delay(100): add some delaybe ween reads
)
Result in serial aniter
es ee a
Main arduino code
2etine vk Ad