Reading RS232, buffers, line feeds etc

I want to read a single character from the RS232 port to turn on or off debug / interest features in my program.

Here's the code I am using:

if (Serial.available() > 0)
{
        // read the incoming byte:
       int incomingByte = Serial.read();

        if (incomingByte == 83)  // "S" 
           // do something

        if (incomingByte == 115) // "s" 
           // do something else
}

Now that works, BUT I have to type the character I want, followed by a carriage return.

What code can I use instead to just read a byte unbuffered so I don't need to type the carriage return?

On other platforms and devices I've used a getchar() function but I can't find anything similar for the arduino

What code can I use instead to just read a byte unbuffered so I don't need to type the carriage return?

Nothing on the Arduino is going to affect the program on the PC that is sending the data.

        if (incomingByte == 83)  // "S"

Why? You got something against the much more intuitive

        if (incomingByte == 'S')

I'm using the Serial monitor built into the arduino programming environment.

Are you saying it is THAT that holds the data in a buffer and doesn't send it until you press enter? Any way around that?

I've also tried with Windows Hyperterminal but I can't get that to work at all. It receives data and displays it on the screen but any attempt to send characters to the arduino does not work, my program does not see any data and does nothing.

Any other suggestions.

Re the latter point, yes, stupid me I tend to miss the obvious sometimes.

Are you saying it is THAT that holds the data in a buffer and doesn't send it until you press enter?

Yes.

Any way around that?

Sure. Don't use the Serial Monitor.

Okay, got it working now with Hyper terminal

It just bought back memories of just how rubbish hyper terminal is. The problem was I had flow control set to hardware. And hyper terminal being a typical poorly written windoze application, it seems you can't edit the port parameters once you have set up a connection, so you have to create a new connection and you get one try at getting the port parameters correct.

But it's doing what I want it to now.

That's why I never use HyperTerminal. If the Serial Monitor doesn't serve my purpose, I fire up Visual Studio, and create a C# application that does.

...is a good replacement for Serial Monitor. Bear in mind, under heavy traffic, it occasionally corrupts in-bound data.

I agree with PaulS. It's fairly easy to build your own (but I disagree about the development tool :D).

(but I disagree about the development too

It's the only tool I can use to do my day job. Since I like to make money, I've become fairly adept at using the tool, so I use it for other stuff, too.

It just bought back memories of just how rubbish hyper terminal is. The problem was I had flow control set to hardware. And hyper terminal being a typical poorly written windoze application, it seems you can't edit the port parameters once you have set up a connection, so you have to create a new connection and you get one try at getting the port parameters correct.

If we put some kechup on your hyperterminal sh*t sandwich will that make you happy? 8)

PaulS:
It's the only tool I can use to do my day job.

Bummer. Well, sort of. C# is nice. I don't have anything bad to say about it.

Since I like to make money, I've become fairly adept at using the tool, so I use it for other stuff, too.

Yeah, money is good. And it's nice not to have to constantly refer to reference manuals.

But, man, I am loving Python + Arduino!