sindyvirgo
Joined: 15 Jan 2009 Posts: 8
|
How should I get word bunch inside the array. |
Posted: Fri Jan 16, 2009 9:55 pm |
|
|
How should I get word bunch inside the array.
I am sorry, I am a beginner.
I declare a array to preserve the materials that UART read in.
There are words which I want inside the array.
How should I write this procedure?
Some procedures are as follows.
I can already accept the materials of UART and put into array.
Suppose that there is 1234567890 inside the materials that I accept now.
I only want to get 456 inside, how should I do.
Code: |
char Msg_buff[512];
#int_RDA
void RDA_isr(void)
{
Msg_buff[Array_number] = getc();
if(Array_number < 512)
{
Array_number = Array_number + 1;
}
else
{
Array_number = 0;
}
}
void rs232_buff_cls()
{
for(Array_number=0 ; Array_number<512 ; Array_number++)
Msg_buff[Array_number]=' ';
Array_number=0; //RS232 Buff Point set to 0
}
void main()
{
enable_interrupts(INT_RDA);
enable_interrupts(INT_SSP);
enable_interrupts(GLOBAL);
set_uart_speed(4800);
} |
|
|