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

Problem with the USB cable disconneted #274

Open esportsim opened 1 year ago

esportsim commented 1 year ago

Hi, this is Carlo. Thanks for this amazing library. I have a problem. I use the leonardo and when I unplug the usb cable from the PC the code cycle very slowly. Do you know why? it's normal or it can be solved? thanks you

MHeironimus commented 7 months ago

If you are trying to communicate on the Serial port and you are not connected to the host computer (i.e., you unplug the USB cable), that can cause a slowdown in some cases.

esportsim commented 7 months ago

There is a way to know if the usb cable is attached?

Il giorno ven 10 nov 2023 alle 22:44 Matthew Heironimus < @.***> ha scritto:

If you are trying to communicate on the Serial port and you are not connected to the host computer (i.e., you unplug the USB cable), that can cause a slowdown in some cases.

— Reply to this email directly, view it on GitHub https://github.com/MHeironimus/ArduinoJoystickLibrary/issues/274#issuecomment-1806476783, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARQ7AYBPETHFQUB7KX4LMF3YD2N4RAVCNFSM6AAAAAAW4BTXPGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBWGQ3TMNZYGM . You are receiving this because you authored the thread.Message ID: @.***>

MHeironimus commented 7 months ago

I have never done anything like that, but a quick search returned the following ideas:

Also, this may not be your issue. It was just a though.

esportsim commented 7 months ago

Thank you very much.

Il giorno ven 10 nov 2023 alle 23:01 Matthew Heironimus < @.***> ha scritto:

I have never done anything like that, but a quick search returned the following ideas:

- https://arduino.stackexchange.com/questions/438/how-does-this-code-line-detect-if-a-serial-interface-is-connected

https://forum.arduino.cc/t/solved-detecting-serial-communication/500914/24

https://forum.arduino.cc/t/checking-if-arduino-is-connected-serial-usb-to-a-pc/336007/26

Also, this may not be your issue. It was just a though.

— Reply to this email directly, view it on GitHub https://github.com/MHeironimus/ArduinoJoystickLibrary/issues/274#issuecomment-1806492996, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARQ7AYCI7HH5NV3QK32XJGDYD2P2RAVCNFSM6AAAAAAW4BTXPGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBWGQ4TEOJZGY . You are receiving this because you authored the thread.Message ID: @.***>