Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulate joystick unplug #282

Closed
valmontechno opened this issue Jan 2, 2024 · 2 comments
Closed

Simulate joystick unplug #282

valmontechno opened this issue Jan 2, 2024 · 2 comments

Comments

@valmontechno
Copy link

Description of Issue

I'm looking for a way to completely stop the joystick emulation, like it had been unplugged. I thought Joystick.end() was used for this but it doesn't seem to have any effect. The only way I found to achieve this is to reset the arduino. Is there any other less radical way?

Technical Details

  • Arduino Board: Arduino Micro
  • Host OS: Window 10, Raspbian
  • Arduino IDE Version: 2.2.1

Sketch File that Reproduces Issue

#include <Joystick.h>

Joystick_ Joystick;

void setup() {
  delay(10000);
  pinMode(15, OUTPUT);
  digitalWrite(15, LOW);
}

void loop() {

}

Wiring Details

Pins 15 and reset are connected.

@nopbxlr
Copy link

nopbxlr commented Jul 6, 2024

Hello,
Bit of a late reply - but this closed issue has a USB reset function given by the repo author.
#288 (comment)
You should be able to simulate joystick unplug with this, with a bit of modification
Hope this will help you or anyone passing by

@valmontechno
Copy link
Author

Thanks, UDCON does indeed allow you to disable the USB port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants