name
setMultiplier ( )
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);
  
  println("tolerance: " + stick.getTolerance());
  
  button = device.getButton("Taste 0");
  
  fill(0);
  rectMode(CENTER);
}

float totalX = width/2;
float totalY = height/2;
float multiplier = 1;

void draw(){
  background(255);
  
  if(button.pressed()){
    fill(255,0,0);
    multiplier += 0.05;
  }else{
    fill(0);
    multiplier -= 0.1;
    multiplier = max(1,multiplier);
  }
  
  stick.setMultiplier(multiplier);
  
  println("multiplier: " + stick.getMultiplier());
  
  totalX = constrain(totalX + stick.getX(),10,width-10);
  totalY = constrain(totalY + stick.getY(),10,height-10);
  
  rect(totalX,totalY,20,20);
}
description
The value of a stick is a relative value between -1.0f und 1.0f with the multiplier you can increase and decrese this range. Use this method to set the actual multiplier. By default this value is 1.0.
syntax
setMultiplier(i_multiplier);
returns
None
usage
application
related