Joke Collection Website - Public benefit messages - C language program for controlling mobile phone module to send short messages by single chip microcomputer

C language program for controlling mobile phone module to send short messages by single chip microcomputer

The current GSM module is a serial communication protocol. Look for the AT command on the Internet, and you will understand it after a brief look. This process is very simple and can be completed by using the serial port of single chip microcomputer.

uchar code * STATES = " AT $ no sleep = 1 \ r \ n "; // \r Yes

Invalid sending (uchar SMS [])

{

uchar I = 0;

While (SMS [i]! ='\0')

{

SBUF = SMS[I];

And (! TI);

TI = 0;

i++;

}

}

Send (country);

In this way, those commands and carriage returns are sent to the module through the single chip microcomputer. I haven't done it before. I've been debugging it for two hours. This method is possible. We'll communicate if there is a problem! !