Anda di halaman 1dari 1

CODE_C

sbit LCD_RS at P2.B0;


sbit LCD_EN at P2.B1;
sbit
sbit
sbit
sbit

LCD_D7
LCD_D6
LCD_D5
LCD_D4

at
at
at
at

P2.B5;
P2.B4;
P2.B3;
P2.B2;

void main() {
Lcd_Init();
Lcd_Cmd(LCD_CLEAR);
Lcd_Cmd(LCD_CURSOR_OFF);
Lcd_Out (1,1,"Lpg Leakage Sys");
while (1)
{
if (p1_1=1)
{
p1_0=0;
lcd_Out (2,1,"Leakage
for (i=1;i<=500;i++)
{
p0=0x01;
delay_ms
p0=0x04;
delay_ms
p0=0x02;
delay_ms
p0=0x08;
delay_ms
}

// Initialize LCD
// Clear display
// Cursor off

");

(100);
(100);
(100);
(100);

}
else
{
p1_0=1;
lcd_Out (2,1,"No Leakage");
}
}
}

Page 1

Anda mungkin juga menyukai