kapistran
Newbie level 2
- Joined
- Apr 20, 2013
- Messages
- 2
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- tanzania
- Activity points
- 1,297
i created the gsm based gas leakage detector and alert system by using pic 16f877a i wrote the following code but when i compile by using mikroc, it gives an error can you help me to remove such kind of errors.
sbit sensorA at RA0_bit;
sbit LCD_RS at RB7_bit;
sbit LCD_EN at RB6_bit;
sbit LCD_D4 at RB5_bit;
sbit LCD_D5 at RB4_bit;
sbit LCD_D6 at RB3_bit;
sbit LCD_D7 at RB2_bit;
sbit LCD_RS_direction at TRISB7_bit;
sbit LCD_EN_direction at TRISB6_bit;
sbit LCD_D4_direction at TRISB5_bit;
sbit LCD_D5_direction at TRISB4_bit;
sbit LCD_D6_direction at TRISB3_bit;
sbit LCD_D7_direction at TRISB2_bit;
void main(){
trisA=0b00000001;
trisB=0boooooooo;
portB=0b00000000;
trisc.b3=0;
trisc.b4=0;
trisc.b3=0;
portc.b4=0;
portc.b3=0;
adcon1=0b00000111;//make portA pins digital i/os
lcd_Init();
lcd_Cmd(_LCD_CLEAR);
lcd_Cmd(_LCD_CURSOR_OFF);
while(1)
{
if(!sensorA)//if portA RA0_bit is low
{
lcd_out(1,1"GSM SYSTEM");
lcd_out(2,1"NO GAS LEAKAGE");
portC=0;
}
if(!sensorA)
{
lcd_out(1,1,"GSM SYSTEM");
lcd_out(2,1,"GAS LEAKAGE");
UART1_INIT(9600);
uart1_write("at+cmgf=1\t\n\r");
uart1_write("at+cmgs=0653101078\n\r\t");
uart1_write_text("gas LEAKAGE\n\r");
portC=0*18;
while(1)
{
if(!sensorA)
break;
}
}
}
}
sbit sensorA at RA0_bit;
sbit LCD_RS at RB7_bit;
sbit LCD_EN at RB6_bit;
sbit LCD_D4 at RB5_bit;
sbit LCD_D5 at RB4_bit;
sbit LCD_D6 at RB3_bit;
sbit LCD_D7 at RB2_bit;
sbit LCD_RS_direction at TRISB7_bit;
sbit LCD_EN_direction at TRISB6_bit;
sbit LCD_D4_direction at TRISB5_bit;
sbit LCD_D5_direction at TRISB4_bit;
sbit LCD_D6_direction at TRISB3_bit;
sbit LCD_D7_direction at TRISB2_bit;
void main(){
trisA=0b00000001;
trisB=0boooooooo;
portB=0b00000000;
trisc.b3=0;
trisc.b4=0;
trisc.b3=0;
portc.b4=0;
portc.b3=0;
adcon1=0b00000111;//make portA pins digital i/os
lcd_Init();
lcd_Cmd(_LCD_CLEAR);
lcd_Cmd(_LCD_CURSOR_OFF);
while(1)
{
if(!sensorA)//if portA RA0_bit is low
{
lcd_out(1,1"GSM SYSTEM");
lcd_out(2,1"NO GAS LEAKAGE");
portC=0;
}
if(!sensorA)
{
lcd_out(1,1,"GSM SYSTEM");
lcd_out(2,1,"GAS LEAKAGE");
UART1_INIT(9600);
uart1_write("at+cmgf=1\t\n\r");
uart1_write("at+cmgs=0653101078\n\r\t");
uart1_write_text("gas LEAKAGE\n\r");
portC=0*18;
while(1)
{
if(!sensorA)
break;
}
}
}
}