[Teensy LC] Joystick drifts, but no analog stick is connected

Hello, I was just testing out the Teensy LC and made a simple loop, in the Joystick mode, for pressing a button and releasing a button.

I've tested it out in games, if it would work (It did), but after few minutes the character just moved left. I looked in the "joy.cpl" file on windows (which is basiclly a file / programm where you can look up, if a button was pressed or not on a gamepad) and saw that the left analog stick was drifting.

Is there a fix to that driftig, do I need to buy a new Teensy or is there some other way?

Code:

const int ledPin = 13;

void setup() 
{
  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, HIGH);
}

void loop() 
{ 
  Joystick.button(1, 1);
  delay(500);
  Joystick.button(1, 0);
  delay(500);
}

Results from "joy.cpl":

Teensy Setup:

Teensy (Teensy® LC or Arduino Official Store | Boards Shields Kits Accessories):

If I need to provied some more information, just ask

Thanks in advance!

The picture of the Teensy seems to be missing the Joystick, so where do you have the joystick connected ?

With floating inputs the results are dependent on the phase of the moon in relation to Mars. In other words it is unknown, can change and can be anywhere between 0 and VCC.

1 Like

That's the confusig part, nowhere.
Like it drifts, even if no analog stick is connected

Why is it 'confusig' ?

The code you wrote expects a joystick to be connected.

Is it a surprise the code to read a joystick does not work correctly if there is no joystick connected ?

Maybe the best thing is to post a schematic, not a frizzy pictures showing exactly how you have wired it. Include links to technical information on all the hardware as well.

I'll try to connect a Joystick tomorrow and update my current status, like if it worked or not.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.