#include<p18cxxx.h>
#include<delays.h>
#include<xlcd.h>
#pragma config OSC=HS
#pragma config WDT=OFF
#pragma config LVP=OFF
#pragma config BOR=OFF
#pragma config MCLRE=OFF
char str1[]="I am PIC18F";
char str2[]="How are you?";
#pragma code
void DelayFor18TCY(void)
{
Delay10TCYx(2);
}
void DelayPORXLCD(void)
{
Delay1KTCYx(15);
}
void DelayXLCD(void)
{
Delay1KTCYx(5);
}
void main(void)
{
ADCON1=0xEF;
OpenXLCD(FOUR_BIT&LINES_5X7);
WriteCmdXLCD(CURSOR_OFF&BLINK_OFF);
while(1)
{
SetDDRamAddr(0x80);
putsXLCD(str1);
SetDDRamAddr(0xC0);
putsXLCD(str2);
}
}
НАЗАД ДАЛЕЕ