applecrepe
Newbie level 4
Hi,
About my project is that it allow user to key in their phone number using keypad. Then once the switch is on it will sent a sms to the user.
But It cannot sent out to the user.
Below are my codes for the modem:
The ( input_number ) are the number that the user keyed in and is stored inside.
Need help, Thanks.
About my project is that it allow user to key in their phone number using keypad. Then once the switch is on it will sent a sms to the user.
But It cannot sent out to the user.
Below are my codes for the modem:
Code:
//Initializing Modem and send message
putrsUSART((const far rom char *)"AT\r\n");
while(!BusyUSART())
Delay10KTCYx(50); //50x10k instruction cycle = 0.5s delay
putrsUSART((const far rom char *)"AT+CMGF=1\r\n"); //Operatng in SMS text mode
while(!BusyUSART());
Delay10KTCYx(50); //50x10k instruction cycle = 0.5s delay
putrsUSART((const far rom char *)"AT+CNMI=2,1,0,0,1\r\n"); //setting for reading SMS
while(!BusyUSART());
Delay10KTCYx(50); //50x10k instruction cycle = 0.5s delay
putrsUSART((const far rom char*)"AT+CMGS=");
putcUSART(0x22);
putsUSART(input_number);
putcUSART(0x22);
putrsUSART((const far rom char *)"TEST WITH KEYPAD\x1A\n"); //message to be sent
while(!BusyUSART());
Delay10KTCYx(50); //50x10k instruction cycle = 0.5s delay
//LED blink alternately to indicate SMS is sending
LEDSMS = 0; //toggle PORTB content(off)
Delay10KTCYx(100); //50x10k instruction cycle = 0.5s delay
LEDSMS = 1; //toggle PORTB content(on)
Delay10KTCYx(100); //50x10k instruction cycle = 0.5s delay
LEDSMS = 0; //toggle PORTB content(off)
Delay10KTCYx(100); //50x10k instruction cycle = 0.5s delay
LEDSMS = 1; //toggle PORTB content(on)
Delay10KTCYx(100); //50x10k instruction cycle = 0.5s delay
LEDSMS = 0; //toggle PORTB content(off)
LEDSMS = 0; //Reset PORTB
Delay10KTCYx(100); //50x10k instruction cycle = 0.5s delay
The ( input_number ) are the number that the user keyed in and is stored inside.
Need help, Thanks.