Joke Collection Website - Public benefit messages - Single chip microcomputer +GSM module, always sending short messages, why only send one?

Single chip microcomputer +GSM module, always sending short messages, why only send one?

while( 1)

{

Delay (1);

UART 1 _ putstring(" AT+CIMI \ r \ n ");

Delay (10);

for(I = 0; I & lt50; i++)

{

if (strstr(uart_buf," AT+CIMI ")& amp; & ampstrstr(uart_buf," OK "))

{

I = 5;

Break;

}

}

If(i==5) is broken;

}

Try to remove while( 1), and it will become as follows:

Invalid master (invalid)

{

uint 8 I;

UART 0 _ init(); //Serial port initialization

GSM _ init(); // TC35 initialization

EA = 1; //Enable interrupt

while( 1)

{

IGT = 1;

Delay (100);

IGT = 0;

Delay (100);

IGT = 1;

Delay (100);

Delay (100);

//Detect whether TC35 is started.

Break;

}

Delay (1);

UART 1 _ putstring(" AT+CIMI \ r \ n ");

Delay (10);

for(I = 0; I & lt50; i++)

{

if (strstr(uart_buf," AT+CIMI ")& amp; & ampstrstr(uart_buf," OK "))

{

I = 5;

Break;

}

}

If(i==5) is broken;

led 2 = 1;

UART 0 _ flush _ buf();

UART 1 _ flush _ buf();

GSM _ send _ back(" AT \ r \ n ");

GSM _ send _ back(" AT+CMGF = 1 \ r \ n ");

GSM _ send _ back(" AT+CSMP = 17, 167,0,0 \ r \ n ");

GSM _ send _ back(" AT+CSCS = GSM \ r \ n ");

GSM _ send _ back(" AT+CMGS = 13645 16875 1 \ r \ n ");

GSM _ send _ back(" hello \ x 0 1A ");

}//corresponding main function