LEGO® Answers is a question and answer site for LEGO® and building block enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way for me to set up my Mindstorms robot so that when I push one of the touch sensors it sends a signal to the computer to press a key?

share|improve this question
Is the computer in question capable of receiving Bluetooth messages? – Ambo100 Oct 5 '13 at 17:38

Yes, this is possible.

First, you'll want to connect your NXT to the computer using Bluetooth. Make sure you can connect to it with the official LEGO Software programming environment, NXT-G, and that the computer connection will show up when you go to Bluetooth > Connections.

Next, you'll want to create a simple program in NXT-G and download it to your NXT. It should basically send a Bluetooth message to the computer, using Mailbox #1 and a number variable containing the value of the key pressed. If you need help with this part, I can provide detailed steps.

Finally, you'll want to use a program called InstantEXE 3.0 (the free version works!) to receive the Bluetooth signal and use the command "Keys" to simulate the key or key sequence that you want to be triggered when the button is pressed. You can expand this with your sensors, e.g. when touch sensor #1 is pressed send it with a value and intercept this on the computer, using InstantEXE 3.0 to convert it into a keysequence. If you need help with this part, I can provide detailed steps and/or a sample program for you to use. You could use some basic labels like the following script:


Keys "L"


Keys "C"


Keys "R"

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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