That's not the best idea with V-USB, Serial TX functions are blocking
V-USB documentation says usbPoll must be called every 10 ms or less
emada, when things gets stuck, try looking for while loops that might get stuck, there are a few in there that checks whether or not the interrupt endpoint is ready, try sticking usbPoll inside them.
ok well i was able to use serial but that didnt really tell me anything i didnt already know, can i do a try/catch kinda thing with that? i also added usbPoll to the while loops in UsbKeyboard.h but it still hangs on sendKeyStroke could it just be its waiting for a response maybe and my hardware is messed up? thanx for the tips so far guys!! what else can i try to get this damn thing working?
Forget about debugging anything until you can enumerate properly... start with blank code that does nothing but a loop that calls usbPoll, aka, Update
If it can't enumerate, figure out why, triple check your usbconfig.h , make sure the delay between the simulated disconnect-then-reconnect is long enough (according to that library's source code, there is no delay at all, insert one in there)
ok i took everything out except usbUpdate(), still no enumeration love.
im using:
2.2k-Ohms resistor ".5 watt - %5 tolerance"
2x 68-Ohm resistors ".5 watts - %5 tolerance"
2x .5W 3.6V Voltage Regulator Zener Diodes
and a hacked up usb cable
I wasn't able to add any connects/disconnects to usbconfig.h, every time I added something it wouldn't compile
well i know it hangs because when i push the button on pin 12 the onboard red led should turn on "pin 13" then it should send data and turn the led back off. However when i push the button the led turns on and never turns back off so its getting stuck on sendKeyStroke. If i comment all them out the led turns on and off as expected.
I fear this has something to do with it not enumerating properly on the system before trying to send data to it.