aparna_ece
Newbie level 3
- Joined
- Feb 23, 2014
- Messages
- 4
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 33
I use hitech c compiler 9.70 and pic16f877a microcontroller , the following code compiled successfully but shows warning [359] illegal conversion between pointer types how can I clear this warning ,what is wrong with my code?
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 #include<pic.h> #include<htc.h> #include<string.h> #define XTAL_FREQ 4e6 __CONFIG (0x3F3A); void gsm_init(); void str_2_ch(char* str); void main() { TRISC=0x80; TRISD=0; PORTC=PORTD=0x00; while(1) { gsm_init(); str_2_ch("AT"); TXREG=0x0D; PORTD=0x01; str_2_ch("AT+CPIN?"); TXREG=0x0D; PORTD=0x03; str_2_ch("ATD9xxxxxxxxx;"); TXREG=0x0D; PORTD=0x07; str_2_ch("AT+CMGF=1"); TXREG=0x0D; PORTD=0x0F; str_2_ch("AT+CMGS="); TXREG=0x22; PORTD=0x1F; str_2_ch("+919xxxxxxxxx"); TXREG=0x22; PORTD=0x3F; TXREG=0x0D; str_2_ch("HI"); TXREG=0x1A; TXREG=0x0D; PORTD=0x1F; } } void gsm_init() { SPBRG=25; SYNC=0; SPEN=1; } void str_2_ch(char *str) { int i; for(i=0;i<strlen(str);i++) { unsigned char data; data=str[i]; if(TXIF==1) { TXREG=data; TXEN=1; while(str[i]!='\0'); } } }
Last edited by a moderator: