MHeironimus / ArduinoJoystickLibrary

An Arduino library that adds one or more joysticks to the list of HID devices an Arduino Leonardo or Arduino Micro can support.
GNU Lesser General Public License v3.0
2.06k stars 403 forks source link

Simulate joystick unplug #282

Open valmontechno opened 6 months ago

valmontechno commented 6 months ago

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

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.