Programming LCD + LDR in PIC16F877A

Thread Starter

Rasya

Joined Oct 8, 2011
2
Hello..i realy need help.i am doing my final project which is the first timer.what i need now is the programming of LCD n PIC and LDR:) irealy need it urgent:(
 

bertus

Joined Apr 5, 2008
20,773
Hello,

I got this in a mail from you:

Hello I realy need ur help :) i am doing my final project and start connecting the hardware and its working.my project topic are Smart Car parking system.. What i totally blank is the programming pic with lcd 16x2..i realy need ur help
As I have never worked with the pics, I can not help you.

Bertus
 

Thread Starter

Rasya

Joined Oct 8, 2011
2
#include<16f877a.h>
#use delay (clock=20000000)
#fuses hs, noprotect,nowdt,nolvp
#define use_portb_lcd TRUE
#include<lcd.c>

#byte portb=6
#byte portc=7
#byte portd=8


byte count;



void main()

{

long count=0;

int sta;
int stax;
set_tris_b(0);
set_tris_c(0b11111111);
set_tris_d(0);

lcd_init();
lcd_putc( "SMART PARKING ");


portb=0x00;
portd=0x00;


do
{

if(input(PIN_C0)==0 && sta==1) // bila tekan switch
{



sta=0;
count=count+1;
lcd_putc("\f");
portb=printf(lcd_putc, "AVAILABLE:%lu",count);
if(count>=5&&count<=50)
{

lcd_gotoxy(1,1);
lcd_putc("EXCEED LIMIT....");
output_high(pin_d0); //buzer on


}



}


////////////////////////////////////////////////////////////////////////////

if(input(PIN_C1)==0 && stax==3)
{



count=count-1;
lcd_putc("\f");
portb=printf(lcd_putc, "AVAILABLE:%lu",count);

if(count>=51&&count<=65535)
{

lcd_gotoxy(1,1);
lcd_putc("PARKING FULL....");
output_high(pin_d0);


}
else
{
output_low(pin_d0);
}


}
if(input(PIN_C0)==1)
{ sta=1; }
delay_ms(100);



if(input(PIN_C1)==1)
{ stax=3; }
delay_ms(100);

}while(1);

}
 
Top