String numeric output with V-USB HID

Johan,

As soon as the sketch uploads, the Arduino reboots and the Arduino USB port keeps the same serial port. The V-USB port is completely separate and can be plugged into the PC at the same time as the Arduino port is active as virtual com. The V-USB side will take on the personality of HID keyboard. If you use two USB ports simultaneously, only one (the Arduino) must power the Uno.

-UNO connect to pc - upload sketch - UNO disconnect - connect usb-circuit - open excel?

  • Program the UNO on factory USB
  • Unplug the UNO
  • Open Excel, load the template, position cursor into A1
  • Plug in the V-USB port noting that power now comes over this connection!
  • After about 10-15 seconds, the Uno will start sending keystrokes to Excel

I usually use ArduinoISP and load the sketch that way because I am working with perfboard designs and it is silly to waste a USB connector for a port that would only be used to program. But for bench testing, etc., you can use two ports... but the PC will see them as two different devices.

Where this differs from the Leonardo, is that the 32U4 is connected to only one USB port and that port can be Comm or that port can be HID, but not both at the same time. Uno can be both since it uses a separate Atmel chip for the serial comms.

Ray

Added:
Excel does not have a clue! As far as Excel is concerned, the keystrokes come from a keyboard and the software cannot determine if there is one or more keyboards connected; all it 'sees' is just keystrokes.