You are on page 1of 1

unsigned int adc_rd;

char txt[12];
float b1,b2;
char *text;
void disp();
void main()
{
text = " SOLAR STREET ";
LCD8_Out(1,1,text);
text = "
LIGHT
";
LCD8_Out(2,1,text);
delay_ms(1800);
LCD8_Cmd(LCD_CLEAR);
PORTC.F0=0;
PORTC.F1=0;
while (1)
{
adc_rd = ADC_read(0);
b1= (adc_rd *5)/(1024);
b1=b1*3;
floatToStr(b1,txt);
LCD8_Out(1,6,txt);
text ="Solar I/P:";
LCD8_Out(1,1,text);
if(b1<=3)
{
PORTC.F0=1;
}
if(b1>4)
{
PORTC.F0=0;
}
if(b1>12)
{
text ="Regulated Chrg ";
LCD8_Out(2,1,text);
PORTC.F2=0;
PORTC.F3=0;
}
if(b1<12)
{
text ="Unregulated Chrg";
LCD8_Out(2,1,text);
PORTC.F2=1;
PORTC.F3=1;
}
}
}

You might also like