custom program. plz help

Hi

I want to surprise my friend with a simple programming trick. I need some help in that. I will really appreciate it if anyone can help me out.

I want to write a program that should ask me to "press any key to continue". But when i press "ENTER" i want it to display a message like "YES" but if i press any key other than "ENTER" i want it to display a different message like "NO". Any ideas please.........

This forum is for programming microcontrollers, they typically don't have an "ENTER" key.

Well we can program Micro Controller. Is there anyway we can program it to do that way

Well, you would need to connect a "keyboard" with an "enter" key to the arduino, then also attach a "display" device to be able to see the result you describe. Search the board for the above key words for any relevant info, then develop specific questions where you have problems.

I am working on this already. I connected my Arduino board to my laptop which has windows XP. I also connected LCD to my Arduino board. Now i am trying to program it.
I need a program that asks me to “press any key to continue” and depending on which key i hit on keyboard i want it to give a different output message. Like if i hit “ENTER” it should display “I am arduino” and if i hit any other key it should display “Other key”.

I hope i am clear this time lol
By the way thanks for replies guys. I really appreciate it if you guys helped me out to do this. Thanks once again.

Ok .. are you tring to ..

1) make a program on your computer that will prompt for a key. When the key is pressed, it tells the arduino what key was pressed and the arduino can display it on the LCD.

... or ...

2) Do you want to attempt to read the keyboard directly by the arduino directly with no PC involved (once programed)?

... or ...

3) ... either way .. whatever is easy

Next question .. if the PC is involved, what application are you programing with. Looking at your name, I would think Java. If so, do you know how to talk to the serial port / can you communicate with the arduino via the serial connection?

Well there is PC involved. We program Arduino in C. What i am doing is that i want to program Arduino to detect what key i pressed on my keyboard and depending on that i want it to display a different message. Like if i press ENTER key it should display one message and if i enter any other key it should display other message.

This is what i did till now

input_value=getc(stdin); if (input_value='\n') { printf("you pressed enter key")} else printf("you pressed other key")

I am able to detect if someone presses ENTER key but when i press other key i am not getting out of GETC commad. so i am trying to detect SHIFT key now.

Let me know if anyone has any idea

Thanks guys !!

Am I correct to assume that

1) The "keyboard" is connected to your PC rather than to the Arduino 2) You actually want the "you pressed enter key" to appear on an LCD connected to the Arduino

Have you tried an Arduino-"Hello world" program? (to see if you can display anything on the LCD regardless of what keys are being pressed)