hi

Beta Testing discussion on mikroBasic PRO for PIC.
Post Reply
Author
Message
kapistran
Posts: 4
Joined: 23 Apr 2013 18:10

hi

#1 Post by kapistran » 23 Apr 2013 18:30

:oops: the code written below gives an error during compilation can you help me to solve that problem
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;
}
}
}
}

veljko.pavlovic
Posts: 59
Joined: 15 Apr 2013 11:19

Re: hi

#2 Post by veljko.pavlovic » 25 Apr 2013 16:08

Hello,

Which MCU do you use?

Best regards,
Veljko Pavlovic.

kapistran
Posts: 4
Joined: 23 Apr 2013 18:10

Re: hi

#3 Post by kapistran » 27 Apr 2013 15:26

PIC 16F877a

kapistran
Posts: 4
Joined: 23 Apr 2013 18:10

Re: hi

#4 Post by kapistran » 27 Apr 2013 16:08

i need to creat the gsm based gas leakage detector and alert system by using pic 16f877a as a controller.that code i send to you last week gives an errors when i compiled.The circuit composed of the following component:-
1.lcd 2x16
2.gas sensor
3.gsm modem sim300
4.buzzer
Gas sensor act as input to the microcontroller so when the gas is detected through a gas sensor pin RA0 at mcu will be high so i need the lcd to display the message as gas leakage and to send the message through predefined number by using gsm modem and vice versa when pin RA0 is low also i need a buzzer to sound when the gas is detected. please check those code which i send to you and help me to correct those errors if its possible sir.

veljko.pavlovic
Posts: 59
Joined: 15 Apr 2013 11:19

Re: hi

#5 Post by veljko.pavlovic » 29 Apr 2013 16:07

Hello,

Please try with attached file.
There was minor errors and now it should work.

Best regards,
Veljko Pavlovic.
Attachments
Example.rar
(1.53 KiB) Downloaded 219 times

kapistran
Posts: 4
Joined: 23 Apr 2013 18:10

Re: hi

#6 Post by kapistran » 29 Apr 2013 17:18

:) thanks very much sir the program is successfully compiled without error

Post Reply

Return to “mikroBasic PRO for PIC Beta Testing”