I am using Nios II to program the Altera DE2 board using C, along with a PC running Windows. The user must enter a number via the PC's keyboard. Every time the user enters a number, I want to immediately display it on the DE2's seven-segment LED display.
Sounds simple, right? But there's a problem... when I get the character using the getchar() function, the user must hit the Enter key in order for the program to get the character. I don't want this... I want to get the character immediately after the user presses the key. I don't want the user to have to press the Enter key in order for the program to get the character.
How do I do this? I think the problem is that getchar() is a "buffered" function. I want unbuffered input.
There is a function called getche() that I think would do the trick. But it is part of <CONIO.H>, and Nios apparently doesn't support it.