arduino - Teensy 3.1 keyboard script execution -


i'm trying program teensy 3.1 keyboard, , i'm using example https://www.pjrc.com/teensy/td_keyboard.html.

int count = 0; void setup() { } // no setup needed void loop() {   keyboard.print("hello world ");    keyboard.println(count);   count = count + 1;   delay(5000); } 

i uploaded script teensy , script execution starts immediately. problem after if unplug teensy , plug second time, nothing happening. know doing wrong?

you're not doing wrong; expected behavior. the documentation states:

you may notice "hello world 0" not appear. pc takes brief time detect presence of new usb device, program begins running immediately. if use keyboard.print() before pc finishes detection process (called "enumeration" in usb lingo), keyboard.print() nothing.

the remedy stated is:

a delay() can added in setup(), if necessary.

suggest put nice long delay in setup() give pc time recognize keyboard.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -