Originally Posted by
Salem
Try posting your error messages.
From the look of things (assuming your undeclared gsm variable is a FILE*), that your printf calls should be fprintf
Also, main returns int, not void
Code:
#include <16F877A.h>
#device ADC=10 //for 10 bit resolution
#include "pic.h"
#use delay(CLOCK=20000000)
#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7,stream=pc)
#use rs232(baud=9600,XMIT=PIN_D2,RCV=PIN_D3,stream=gsm)
//void smssend(char *b1,char *b2);
char num[12]="09995995523";
void smssend(char *b1,char *b2)
{
fprintf(gsm,"AT+CMGF=1\r");
fprintf(gsm,"AT+CMGS=");
fputc(34,gsm);
fprintf(gsm,"%s",b1);
fputc(34,gsm);
fprintf(gsm,"\r");
fprintf(gsm,"%s",b2);
delay_ms(100);
fputc(26,gsm);
delay_ms(200);
}
void main()
{
while(1)
{
smssend("12345","JOVIN");
}
}
this is my original code.am wirting a code in mplab for pic programming. I got this error wen i compile
Line 26(16,17): Bad expression syntax