name
getStick ( )
import procontroll.*;
import java.io.*;

ControllIO controll;
ControllDevice device;
ControllStick stick;
ControllButton button;

void setup(){
  size(400,400);
  
  controll = ControllIO.getInstance(this);

  device = controll.getDevice("Logitech RumblePad 2 USB");
  device.printSticks();
  
  stick = device.getStick("Z-Achse Z-Rotation");
  stick.setTolerance(0.05f);
  
  button = device.getButton("Taste 0");
  
  fill(0);
  rectMode(CENTER);
}

void draw(){
  background(255);
  
  if(button.pressed()){
    fill(255,0,0);
  }else{
    fill(0);
  }
  
  float x = stick.getTotalX() + width/2;
  float y = stick.getTotalY() + height/2;
  
  if(x > width + 20 || x < - 20 || y > height + 20 || y < - 20){
    stick.reset();
  }
  
  rect(x,y,20,20);
}
description
Use this method to get a stick. You can get a stick by its name or its number. Use printSticks to see what sticks are available for a device.
syntax
getStick(i_stickNumb);
getStick(i_stickName);
parameters
i_stickNumb
int, the number of the button to return
i_stickName
String, name of the button to return
returns
ControllStick, the stick coresponding to the given number or name
usage
Web & Application
related