Using an ATTiny85 and DigiKeyboard.h, can I detect when USB HID is connected?

Arduino Asked by Bobby Tables on January 4, 2022

I am building a project to send HID keystrokes to a computer with an ATTiny85. I want to detect when the USB communication is working, in order to turn on a LED saying that everything is good. If USB stops working, I want a watchdog to turn the LED off. Ideally it would also attempt to reconnect automatically.

DigiUSB has the DigiUSB.available() method, but DigiKeyboard does not, and I can’t seem to use both headers in the same program because of conflicts. How can I do this without DigiUSB?

Add your own answers!

Related Questions

How to Set RTC in ES32 using NTP server?

1  Asked on December 7, 2021 by abdul-wasey


Holding buttons (keyboard)

1  Asked on December 7, 2021 by amin-abbasi


Is it required to delete variables before going to sleep?

1  Asked on November 30, 2021 by tono-nam


Running Arduino with 2 outputs and 2 inputs

2  Asked on November 25, 2021


How to read a specific amount of data via serial?

1  Asked on November 20, 2021 by noxus-nexus


Can you access the EEPROM of an ATtiny with Arduino Code?

4  Asked on November 17, 2021 by isabel-alphonse


GPS detecting stationary?

1  Asked on November 15, 2021 by linuxferlife


What exactly does the return type do in a function?

2  Asked on November 13, 2021 by grant-scott


MPU6050 Problem with NodeMCU

1  Asked on November 5, 2021


AccelStepper library advanced codes!

1  Asked on September 25, 2021 by 2012user


Arduino I2C external 32Kb fram data organization

1  Asked on September 25, 2021 by steven-gangaram


Ask a Question

Get help from others!

© 2022 All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir