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?
{
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
- Related articles
- How to prevent WeChat privacy from leaking-just turn off these two functions.
- How to remove the red dot of oppo mobile phone icon
- Unable to receive SMS verification code
- Do you have any eggs in the twinkling stars?
- Second trial of forced girl prostitution in Yongzhou, Hunan Province
- How long does it take for Apple to refund and recharge?
- China Mobile error message caused my data usage to exceed
- SMS notification when buying more food.
- What if the owner maliciously defaults on the property fee?
- What's the phone number of this machine?