Ok i have the right hardware built i think and im using the example that comes with the lib from here:
http://code.google.com/p/vusb-for-arduino/code:
#include "UsbKeyboard.h"
#define BUTTON_PIN 12
// If the timer isr is corrected
// to not take so long change this to 0.
#define BYPASS_TIMER_ISR 1
void setup() {
pinMode(BUTTON_PIN, INPUT);
digitalWrite(BUTTON_PIN, HIGH);
#if BYPASS_TIMER_ISR
// disable timer 0 overflow interrupt (used for millis)
TIMSK0&=!(1<<TOIE0); // ++
#endif
}
#if BYPASS_TIMER_ISR
void delayMs(unsigned int ms) {
/*
*/
for (int i = 0; i < ms; i++) {
delayMicroseconds(1000);
}
}
#endif
void loop() {
UsbKeyboard.update();
digitalWrite(13, !digitalRead(13));
if (digitalRead(BUTTON_PIN) == 0) {
//UsbKeyboard.sendKeyStroke(KEY_B, MOD_GUI_LEFT);
UsbKeyboard.sendKeyStroke(KEY_H);
UsbKeyboard.sendKeyStroke(KEY_E);
UsbKeyboard.sendKeyStroke(KEY_L);
UsbKeyboard.sendKeyStroke(KEY_L);
UsbKeyboard.sendKeyStroke(KEY_O);
UsbKeyboard.sendKeyStroke(KEY_SPACE);
UsbKeyboard.sendKeyStroke(KEY_W);
UsbKeyboard.sendKeyStroke(KEY_O);
UsbKeyboard.sendKeyStroke(KEY_R);
UsbKeyboard.sendKeyStroke(KEY_L);
UsbKeyboard.sendKeyStroke(KEY_D);
//UsbKeyboard.sendKeyStroke(KEY_B, MOD_GUI_LEFT);
UsbKeyboard.sendKeyStroke(KEY_ENTER);
#if BYPASS_TIMER_ISR // check if timer isr fixed.
delayMs(20);
#else
delay(20);
#endif
}
}
My set up is like so
DIO2 - green wire
DIO4 - white
DIO5 - white
GRN - grn
5v - 5v
DIO12 - button
i get this in syslog:
Oct 3 21:50:03 emada-laptop kernel: [14576.550470] usb 2-1: new full speed USB device using ohci_hcd and address 38
Oct 3 21:50:03 emada-laptop kernel: [14576.732589] usb 2-1: device descriptor read/64, error -62
Oct 3 21:50:03 emada-laptop kernel: [14577.020127] usb 2-1: device descriptor read/64, error -62
Oct 3 21:50:04 emada-laptop kernel: [14577.312322] usb 2-1: new full speed USB device using ohci_hcd and address 39
Oct 3 21:50:04 emada-laptop kernel: [14577.497535] usb 2-1: device descriptor read/64, error -62
Oct 3 21:50:04 emada-laptop kernel: [14577.782600] usb 2-1: device descriptor read/64, error -62
Oct 3 21:50:04 emada-laptop kernel: [14578.070204] usb 2-1: new full speed USB device using ohci_hcd and address 40
Oct 3 21:50:05 emada-laptop kernel: [14578.492592] usb 2-1: device not accepting address 40, error -62
Oct 3 21:50:05 emada-laptop kernel: [14578.670124] usb 2-1: new full speed USB device using ohci_hcd and address 41
Oct 3 21:50:05 emada-laptop kernel: [14579.092576] usb 2-1: device not accepting address 41, error -62
Oct 3 21:50:05 emada-laptop kernel: [14579.092657] hub 2-0:1.0: unable to enumerate USB device on port 1
attached is also i picture of the set up. anyone have any idea what im doing wrong?