Acessórios Arduino

Produtos visualizados

JoyStick Controller for Arduino

BE15000145

Novo produto

Two of the input value of potentiometer are respectively to show the user offset in the X and Y axis, and the type of offset is analog?the button is used to show whether the user push down button in the Z axis, its type is the digital quantity. Therefore the control rod contain a total of three input interface which are used to connect X, Y, and Z.

Mais detalhes

4,91 € com IVA

Adicionar à Lista de desejos

Mais informação

Specification :
 

  • Adjustable Sensitivity , Stable Performance.
  • Support both the output digital value and the output analog value.
  • Port explanation : DO for digital output, AO for analog output.
  • Two channel simulated output, one digital output
  • X, Y output are separately for two potentiometer which can  read out the twist Angle through the AD transform
  • Applicable to a variety of platforms including Arduino / AVR / ARM.

 

Code:

int sensorPin = 5;
int value = 0;

void setup() {
  pinMode(7, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  value = analogRead(0);
  Serial.print("X:");
  Serial.print(value, DEC);

  value = analogRead(1);
  Serial.print(" | Y:");
  Serial.print(value, DEC);

  value = digitalRead(7);
  Serial.print(" | Z: ");
  Serial.println(value, DEC);

  delay(100);
}

 

Code2:

int JoyStick_X = 0; //x
int JoyStick_Y = 1; //y
int JoyStick_Z = 3; //key
void setup()
{
  pinMode(JoyStick_X, INPUT);
  pinMode(JoyStick_Y, INPUT);
  pinMode(JoyStick_Z, INPUT);
  Serial.begin(9600); // 9600 bps
}
void loop()
{
  int x, y, z;
  x = analogRead(JoyStick_X);
  y = analogRead(JoyStick_Y);
  z = digitalRead(JoyStick_Z);
  Serial.print(x , DEC);
  Serial.print(",");
  Serial.print(y , DEC);
  Serial.print(",");
  Serial.println(z , DEC);
  delay(100);
}

Acessórios

Clientes que compraram este produto também compraram: