It seems that repeated scanfs are not flushing out the read character from the terminal. so what u do is to include a fflush(stdin) before your every scanf call to avoid erronous behaviours.
#include <stdio.h>
int main() {
char up_key,
down_key,
right_key,
left_key;
int speed;
printf("**** Configurazione delle opzioni ****\n");
printf("Immetti...
User Profile
Collapse
-
there is an another function
filelength(int fd); which returns the length of the file associated with the handle fd.
U need to include io.h b4 using this function.Leave a comment:
-
Hi,
Although ur post still doesnt clear the exact nature of your problem, but according to the inadequate threads that hve been goin on, i would like to note the following points:
1. If ur Pointer D is a global one then to free off the pointer inside a local function is a bad practice for u should always free memory in "its scope".
2. Have u tried off with simulataneous alloc and free pipars inside a local function...Leave a comment:
-
Thanx Banfa for notifyin on that front. I tried this out and found out the prob. But can u please tell me why this thing wasnt working that way?
And i hve even bigger query. Although i hve a baud rate of 115200 bps, i need to send thru hyperterminal the data at a character delay of 1 ms else which the receiver UART doesnt accept valid data. and this 1 ms delay is costing my application a whopping 30 minutes to send a 100 kb file to...Leave a comment:
-
UART Reception
Hi all,
I am doing some work on UART. the code to recieve data on my UART from Hyperterminal is as follows:
Recieve(Count, Destination)
{
//Monitor the port to recieve data and continously poll the data.
//A data byte recieved will set the LSB in LCR to 1.
//Thus the CPU has safely read the data
do
{
status = Value in LSR & 0x01;
}while(!status) ;... -
ELF to COFF Converter
Hi,
I need a ELF to COFF Converter. Can any body give me a clue of where it would be available or any source codes for that?
Thanx -
Hi All,
Any array can be defined permanently by adding a "const" intializer to the array.
For example a sample array would look like...
const unsigned int A[5] = {1,2,3,4};
Similar consts can also be used for other data tyoes as well. A good suggestion would bt to go thru YashWant Kanetkars "Let Us C" which goes through these details ina very simple language.
...Leave a comment:
-
Hi Banfa,
Thanx for getting on with that.:-) I have throroughly checked in the documenst for that task and there is nothing missing with my side on the HandShaking Protocol though. However, the variables that i hve assigned writing to the port are simple i.e they are not Volatile. Does a Volatile Declaration of such variables make or break things?
Bye,
SundarrLeave a comment:
-
serial communication
Hi all,
I am trying to get a certain amount of code in to my processor through the on chip UART. i hve developed a program to transmit data through the serial port COM1 but i m not able to direct the data into the chip. And in the echo mode of hyperterminal i m not able to recieve my data. Can any body help me out if i m missing something?
Thanx
No activity results to display
Show More
Leave a comment: