Now, I am using Windows 8 and have made Arduino buttons to operate as an keyboard's 4 arrow keys(up,down, right and left). From this moment, I am going to send this keyboard input event out to the USB port or 9-pin serial port(RS232) installed on the backside of a desktop.

I guess I may need to use windows header and serial communication but thoroughly have no idea, what program or language(C is preferred.) do I have to use. Also even a hardware connection.

Could I get a insight for my goal?

  • \$\begingroup\$ Can you draw a diagram of the setup you want? If the Arduino is generating the button signal, why don't you just get it to talk directly to whatever you plan to plug into the PC's USB port and avoid having to write any code on the PC. \$\endgroup\$ – Jon Jan 30 '16 at 15:02
  • \$\begingroup\$ As I am going to apply additional process in signal communication, I trying to send signal via PC. I may have to connect PC to MCU thru either RS232 port or USB. And that MCU would control a stepper motor finally. "The issue is how could I send the keyboard input to MCU thru USB or rs232. There have been many advice but they weren't showing detail method... even language. \$\endgroup\$ – Jae Seung Kim Jan 31 '16 at 13:23

I basically see two options here:

  • Use your Arduino to become a virtual keyboard (a HID device just like your regular keyboard). This will look to your PC like you have an additional keyboard connected - probably this helps for a start.
  • Use the serial port on your Arduino to send out the data, then read it on your PC using some tool (this is basically your idea). It's pretty easy to do this using C#, it already provides a class called "SerialPort" which basically does the reading for you once you've set it up correctly. From here on, it depends what you want to do with the data you send. An easy example can be found here.
  • \$\begingroup\$ Arduino as an HID? As my arduino is already working as a keyboard, I need a next step, which can process this keyboard input be sent out to the COM port like USB or rs232. Can it be done by C programming? \$\endgroup\$ – Jae Seung Kim Jan 31 '16 at 13:15
  • 1
    \$\begingroup\$ I'm not quite sure what you're trying to achieve .. do you want to press a button on the Arduino which shall then be transferred to the PC or the other way round. What it the ultimate goal you're trying to achieve? \$\endgroup\$ – Tom L. Jan 31 '16 at 15:07
  • \$\begingroup\$ Yes, sir. Please lemme give you a brief. Basically, it begins with 'Arduino Esplora' which includes joystick module on it. And I programmed this joystick work as an 'keyboard arrow keys' using Sketch-Arduino compiler. \$\endgroup\$ – Jae Seung Kim Jan 31 '16 at 17:37
  • \$\begingroup\$ and what's the goal you're trying to achieve in the end? \$\endgroup\$ – Tom L. Jan 31 '16 at 17:42
  • \$\begingroup\$ At this point I concluded that the control of arrow keys are up to Arduino. Next step is sending this keyboard event-which is happened from joystick movement-to external MCU which is connected to PC with USB or RS232 port. The MCU is controlling stepper motor and with a signal from PC, It would operate or stop the motor. \$\endgroup\$ – Jae Seung Kim Jan 31 '16 at 17:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.