I'm totally new to this, but I managed to build a simple box with 4 buttons to send keyboard commands via USB. I've got everything working, including some cool LEDs, and I've included the Bounce library to help weed out the button chatter, but I'm scratching my head on the Keyboard.write command.
I'm able to print a Spacebar press by using Keyboard.write(32). That works great. Unfortunately, no matter what I've tried (integer value, hex or octal format), I can't seem to get the other buttons to fire off an "Esc" or Up or Down Arrows.
I tried the following different iterations of this line for the ESC key, but no dice:
Keyboard.write(0x1B)
Keyboard.write(27)
Keyboard.write(\033)
Keyboard.write(KEY_ESC)
I also tried all of the above with Keyboard.print and Serial.print, to no avail. I've had the same experience with the up and down arrows (KEY_UP_ARROW & KEY_DOWN_ARROW). I'm sure I'm just missing something basic here...any advice would be appreciated.
I've scoured the web for more info on modifier keys and ASCII tables and how to implement them, but nothing worked. I'm programming with Arduino 1.0.3 on Win7 x64, and Teensyduino seems to be integrated correctly. I've selected USB > Serial+Keyboard+Mouse+Joystick, and I can get it to print/write any other basic keys (or strings/messages, i.e. "Hello world!")...just not the ones I need.
Thanks in advance for the help...and for creating such a useful and fun product!
I'm able to print a Spacebar press by using Keyboard.write(32). That works great. Unfortunately, no matter what I've tried (integer value, hex or octal format), I can't seem to get the other buttons to fire off an "Esc" or Up or Down Arrows.
I tried the following different iterations of this line for the ESC key, but no dice:
Keyboard.write(0x1B)
Keyboard.write(27)
Keyboard.write(\033)
Keyboard.write(KEY_ESC)
I also tried all of the above with Keyboard.print and Serial.print, to no avail. I've had the same experience with the up and down arrows (KEY_UP_ARROW & KEY_DOWN_ARROW). I'm sure I'm just missing something basic here...any advice would be appreciated.
I've scoured the web for more info on modifier keys and ASCII tables and how to implement them, but nothing worked. I'm programming with Arduino 1.0.3 on Win7 x64, and Teensyduino seems to be integrated correctly. I've selected USB > Serial+Keyboard+Mouse+Joystick, and I can get it to print/write any other basic keys (or strings/messages, i.e. "Hello world!")...just not the ones I need.
Thanks in advance for the help...and for creating such a useful and fun product!