More GameControlPlus Woes!

Still trying to get the custom joystick working. Have a test test Processing script to access it but the returned data does not change. Here is the setup:

Arduino Micro reading pots via Joystick library
The Arduino is showing up in Windows 10 Game Controllers as “Pololu A-Star 32U4” - which is the previous 32U4 I’ve used.
When I use the Win Game Controller config - it responds to moving of the pots as expected.
In the GameControlPlus configurator I see the pots moving from -1 to 1 as expected.

So what am I missing that I get no changes in the script?
Below is the full test script.

// Libraries for GameControl Plus
import org.gamecontrolplus.gui.*;
import org.gamecontrolplus.*;
import net.java.games.input.*;
import processing.serial.*;
//import java.util.Timer;
//import java.util.TimerTask;


ControlIO control;
ControlDevice stick;

float x,y;
float JOYX, JOYY; // New Joystick coords
float BUTTX, BUTTY; // Joy coords at button press
float cartX, cartY; // joystick as Cartesean coords
float px, py;

float ajx, ajy, th0, th1, th2, X, Y;
float bx0, by0, bx1, by1, bx2, by2;
float dx0, dy0, dx1, dy1, dx2, dy2;


void settings(){
  //fullScreen();
  size(250, 250);    // 950 good on 17"mon
}


void setup(){
  
  control = ControlIO.getInstance(this);
  stick = control.getMatchedDevice("JoyTest2"); 
  //stick.getButton("But0").plug(this, "readStick", ControlIO.ON_RELEASE);  // Must get info from Quark on this function
  //stick.getButton("But1").plug(this, "keyPressed", ControlIO.ON_RELEASE);  // Aux buttons for reset and whatever
  
}

void draw(){
  
  getUserInput();
  noStroke();
  fill(255, 64, 64, 64);
  ellipse(px, py, 20, 20);
  
  print("X: ", JOYX);
  println("  Y: ", JOYY);
  println("");
  print("cartX: ", cartX);
  println("  cartY: ",cartY);
  delay(500);
  
}

void getUserInput() {

  X = stick.getSlider("Xaxis").getValue();
  Y = stick.getSlider("Yaxis").getValue();
  
  px = map(stick.getSlider("Xaxis").getValue(), -1, 1, 0, width);
  py = map(stick.getSlider("Yaxis").getValue(), -1, 1, 0, height);

  ajx = map(X, -1, 1, 0, width);
  ajy = map(Y, -1, 1, 0, height);

  JOYX = ajx;
  JOYY = ajy;
  // av = v >= 0 ? v * v : -v * v;    // From Quark on P Forum
  cartX = map(stick.getSlider("Xaxis").getValue(), -1, 1, -90, 90);
  cartY = map(stick.getSlider("Yaxis").getValue(), -1, 1, 90, -90);
}

public void readStick() {
  // Make sure we have the latest position
  getUserInput();
  //shadows.add(new PVector(px, py, 40));
}

Given that this is a single project with a very narrow set of concerns (custom joystick data using GCP) – you might want to consider keeping your updates and questions all in one active thread, in an ongoing conversation – follow-up questions are perfectly allowed. It is up to you, but in cases like this a unified thread can make it much easier for forum members to come up to speed and contribute.

Yes Jeremy - well aware of that. It was just convenient (while I had his attention!) to spell out my issues to @Quark. I would normally never run multiple conversations in a single thread.

As it turns out - I’ve had to abandon GCP and go to Serial to get my custom joystick data (via an Arduino Micro ) to Processing. When it is all working I’ll put up images and info on how it all works.

=Alan R.

Pardon, but I was saying the opposite – please DO feel free (if you wish) to keep all GCP / custom joystick woes for one project in ONE thread, rather than spinning each off into a separate thread like this one.

Good luck with Serial! Keep us in the loop on your progress.