USBKeyboard.h occasionally hangs

Hi Everyone,

I'm working on an identical project as huntd69. I am hoping to use the VirtualUSBKeyboard sketch to make an Uno act as a USB keyboard.

Like huntd69, my arduino freezes whenever a button is pressed.

Prior to purchasing the USB circuit hardware from Mouser, I wanted to verify that I could get the code to behave correctly. As such, I would like to have the Uno's LED on pin 13 turn off whenever I connect an input pin to the Uno's GND via a jumper.

Unfortunately, whenever I connect the input pin to GND, the Uno freezes. To monitor what is happening, I added the following code at the top of void loop():

void loop()
{
  UsbKeyboard.update();
  Serial.println("New Loop");
  Serial.println(digitalRead(BUTTON_C));
...

This produces the following output:

New Loop
1
New Loop
1
New Loop
1
New Loop
0

From this output, it seems that the Uno is successfully reading that the input pin is connected to GND once, but then freezes. I've tried multiple Unos, but all of them exhibit the same behavior.

Could you provide me with pointers to understand what is happening?

Thanks for your help!
arduinoRobo