Thread: Sending SMS using PIC18F452

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    1

    Sending SMS using PIC18F452

    Code:
    void sendAT()
    {
    	TRISB = 0x00;		    //initialize PORTB as output
    	PORTB = 0x00;	
    	PIR1bits.RCIF = 0x00;	    //Clear PORTB 
    	printf("at+cnmi = 2,2,0,0,1\r\n");
                    Delay10KTCYx(100);                     //Delay
    	while (!PIR1bits.RCIF)	     //Test to see if AT command is sent
    	continue;			     //looping
    	PORTB = PIR1bits.RCIF; 				
                    //LED of RBO will light up if command is sent
    	Delay10KTCYx(100);
    	return RCREG;		    //Return RCREG value
    }
    
    This is a coding i've created...i need to know how to amend the printf line above to send sms.
    
    The AT command is: 
    
    AT+CMGS="+yyyyy" <Enter>
    > Your SMS text message here <Ctrl-Z>
    
    Does anyone out there know how do i input this AT command into the printf line?

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Have you tried \" ?
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sending data - line by line?
    By tuckker in forum C Programming
    Replies: 0
    Last Post: 02-21-2009, 09:31 PM
  2. SMS sample code
    By hagenuk in forum C Programming
    Replies: 1
    Last Post: 05-30-2008, 11:47 AM
  3. a doubt about sending an array to a function
    By louis_mine in forum C Programming
    Replies: 13
    Last Post: 05-14-2005, 11:50 PM
  4. Sms
    By Joanna in forum Tech Board
    Replies: 5
    Last Post: 08-31-2004, 07:25 AM
  5. SMS provider that offer SMS shipping world-wide for under 0,05 € ???
    By gicio in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 05-26-2003, 08:26 PM