Author Topic: Write output to USB connected computer txt file?  (Read 3588 times)

bradlee_s

  • Newbie
  • *
  • Posts: 14
Write output to USB connected computer txt file?
« on: July 23, 2015, 08:00:59 am »
Complete noob. Trying to find simple instructions to write to a USB connected computer. Currently, I have nothing other than a simple onboard LED flashing program working. :)


dougal

  • Sr. Member
  • ****
  • Posts: 289
Re: Write output to USB connected computer txt file?
« Reply #1 on: July 23, 2015, 08:12:19 am »
Try looking at the DigiKeyboard example code.

bradlee_s

  • Newbie
  • *
  • Posts: 14
Re: Write output to USB connected computer txt file?
« Reply #2 on: July 23, 2015, 08:27:43 am »
looking at the example, I don't see anything USB related. perhaps its hidden in the library, but that's not helpful.

perhaps some simple examples on getting started with digicdc? a proper Windows USB serial driver?

dorulk

  • Newbie
  • *
  • Posts: 1
Re: Write output to USB connected computer txt file?
« Reply #3 on: July 29, 2015, 07:09:05 pm »
Complete noob. Trying to find simple instructions to write to a USB connected computer. Currently, I have nothing other than a simple onboard LED flashing program working. :)

Hi, I'm n00b too, but this work for me

Code: [Select]
#include "DigiKeyboard.h"

void setup() {
  // don't need to set anything up to use DigiKeyboard
}


void loop() {
  // this is generally not necessary but with some older systems it seems to
  // prevent missing the first character after a delay:
  DigiKeyboard.sendKeyStroke(0);
 
  // Type out this string letter by letter on the computer (assumes US-style
  // keyboard)
  DigiKeyboard.println("your text here");
 
  // It's better to use DigiKeyboard.delay() over the regular Arduino delay()
  // if doing keyboard stuff because it keeps talking to the computer to make
  // sure the computer knows the keyboard is alive and connected
  DigiKeyboard.delay(5000);
}

bradlee_s

  • Newbie
  • *
  • Posts: 14
Re: Write output to USB connected computer txt file?
« Reply #4 on: July 30, 2015, 07:14:59 am »
Hmm. Would this be interpreted as keystrokes on the host machine? If that's the case, it won't work.

Does anyone have functioning USB Serial drivers for Windows 7 x64??