Computer keyboard/text acting like pushbuttons, Possible ?

.

Hi,
Please try to give us more details.

How will the 'answer' (the analog voltage) be displayed?

Will you use multiple Analog inputs (not just "A0") for multiple sources?

Where will the keystroke ("Ctrl-A") come from? A computer attached to USB? A separate keyboard?

What are you trying to do with this??

Can you tell us more. I don't understand what you want to simulate.

In linux: you can define commands for key presses. The commands could send data to the serial port to the Arduino. Perhaps using Python or zo.

In Windows: The PowerShell is capable to send commands to the serial port.

Why can't you read the serial ? There are numerous posts about projects where people want to read keyboard commands using
"if Serial.available"

http://arduino.cc/en/Serial/read

I still don't understand what you want to do.

It seems like you have a number of sensors connected to the Arduino analog inputs A0 to A5 and you want to be able to send a command from the PC which will make the Arduino read one of the sensors and send the data back to the PC.

That doesn't sound like a difficult task for the Arduino - especially if it can get the command from the PC using serial.read() and send the data back with serial.print() or serial.write().

What software are you proposing to use on the PC to send the commands and receive the data?

...R

Are you saying you don't know how to write IF or CASE statement code ? I just don't understand what part you need help with .
It seems trivial if you say already can read serial (meaning you can decode the control keys you mentioned)
So what's the problem ?

amagro147:
I just know how to set the program to update data, like, I set a delay, and it keep reading all the sensors and plotting all the info.

"I set a delay". That concerns me to start with. No serious application can afford to use the "delay()" function provided in the IDE, so I have to ask- what exactly are you doing?

More to the point really, show us your code!

amagro147:
what i want to do is, that in my program i can select what info will be show on serial print.

like if i press
CTRL A, shows only Sensor 1
CTRL B, shows only Sensor 2

When you use the word "program" I think you mean the program on the Arduino. But you haven't answered my question about what program you are using on your PC.

Put simply there is no system in which pressing CTR A on a PC will make something happen on the Arduino unless you have a program on the PC to catch the key press and send a command to the Arduino.

The PC program that detects the CTRL A can send any suitable command to the Arduino - such as the character 'a' for one reading, 'b' for another or any more sophisticated system you devise to reduce the risk of error.

Until you sort out what program you are going to use on the PC there is not much point worrying about the details of your Arduino program. This demo of using Python for PC to Arduino comms may be of interest.

...R

amagro147:
to end this post. i don't know what people just can't understand

The difficulty is that YOU understand exactly what you want to do but you haven't explained your needs very clearly - perhaps because you are not yet familiar with the jargon of programming.

In simple terms you need to write a small PC program using Python which can detect whatever key presses you want and can then send suitable commands to the Arduino.

This demo shows how a Python program and an Arduino can communicate. You could start with that and modify the Python code to take input from the keyboard. There is a huge amount of online advice about Python programming.

People also use a PC programming language called "Processing" to communicate with an Arduino. I haven't used it but I think it is good if you want a simple way to make a GUI interface on the PC.

...R

to end this post. i don't know what people just can't understand, the problems seems extremely simple to understand, i don't know how would i code that, but thats ok, just don't care anymore.

You said you could read serial.
I asked you if you were saying you don't know how to write IF or CASE statements and you didn't answer.
IF you can read serial AND you know how to write IF and CASE statements, there should be no problem.
So what is it ? If you answer my question I will answer yours ...

I think this about sums it up. What we have here is a failure to communicate.

The difficulty is that YOU understand exactly what you want to do but you haven't explained your needs very clearly - perhaps because you are not yet familiar with the jargon of programming.