(SKU:RB-02S021)PS2 Dual-Axis Joystick

From ALSRobot-Wki
Jump to: navigation, search
Ps2yao.jpg

Contents

Product overview

PS2 game rocker biaxial buttons module adopts SONY PS2 game rocker potentiometer handle original high quality metal buttons, AD hoc 2 analog output and digital output interface module, the output value corresponding biaxial offset (X, Y), the type of analog; Button indicates whether the user has pressed on the Z axis, the type of digital switch. Integrated power module, can display working state; Clear and concise, accurate positioning coordinates identifier; With the can easily control objects (such as well as two degrees of freedom steering gear) in 2 d space motion, so you can programming by the controller, sensor extension board splicing, complete with remote interactive creative works.

specification

  1. Working voltage :3.3v-5v
  2. Plane dimension:27.5×38.2
  3. Analog output interface type: two axle(X,Y)
  4. A digital output key(R)
  5. size of the weight:14g

Method of use

Pin definition

  • X:Analog output(X)
  • Y:Analog output(Y)
  • R:Digital keys output
  • +:(VCC)
  • -:(GND)

Connection shown in figure

  • S ports from the I/O port of the controller. 5 v &gnd received power of + 5 v &gnd respectively

Application of routine

Connect the PS2 rocker arm module and LED a small light in the Arduino UNO, rocker, upon test module

sample program

int joystickX=0;
int joystickY=1;
int x;
int y;
const int buttonPin = 16;     
const int beepPin =  13;      
int buttonState = 0;   
void setup()    
{
  pinMode(joystickX,INPUT);
  pinMode(joystickY,INPUT);
  pinMode(buttonPin,OUTPUT);
  Serial.begin(115200);    
}
void loop()
{
  x=analogRead(joystickX);
  y=analogRead(joystickY);
  Serial.print("#0P");
  Serial.print((500+x*2));
  Serial.println("S2000");
  Serial.print("#1P");
  Serial.print((500+y*2));
  Serial.println("S2000");
  buttonState = digitalRead(buttonPin);
  if (buttonState == HIGH) 
  {     
    digitalWrite(beepPin, LOW);  
  } 
  else 
  {
    digitalWrite(beepPin, HIGH); 
  }
  delay(1);
 } 

Application effect

Toggle the PS2 module rocker, leds light up

Products related to recommend

Buy address:[1]

Personal tools
Namespaces

Variants
Actions
Navigation
Tools