Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 11 months ago.
gsm with kl25z
i am connecting fona gsm module with kl25z , i have written following code ,but it isnt working , help me out here:
- include "mbed.h" Serial pc(PTE22, PTE23); int main() {
#define CTRL_Z 26 char buffer[100]; sprintf (buffer, "This is my message%c", CTRL_Z);
pc.baud(9600); set baudrate to match sim900 module
pc.printf("AT+CMGF=1\r"); AT command to send SMS message wait_ms(100); pc.printf("AT + CMGS = \"+15146028832\""); recipient's mobile number, in international format wait_ms(100); pc.printf("Test"); message to send wait_ms(100);
pc.printf("(char)26"); End AT command with a ^Z, ASCII code 26 wait_ms(100); pc.printf(); wait_ms(500); }
AT+CMGF=1 AT+CMGS="5144497581" text message
i need to press ctrl z to send text, usng char(26) for that. but this isnt working