dientudong
New Member
LCD_please help me !
#include "C:\Program Files\PICC\Examples\hienthiso.h"
#include "C:\Program Files\PICC\Drivers\LCD.C"
#use delay(clock=20000000)
#byte portD=0x08
#byte portB=0x06
#bit RB0=0x06.0
#use fast_io(b)
#use fast_io(d)
int8 mode,i,j;
#INT_EXT
void ext_isr()
{
mode++;
delay_ms(1);
if(mode==3)
{
mode=0;
}
}
void program1();
void program2();
void main()
{
mode=0;
set_tris_b(0b00000001);
portB=0x00;
set_tris_d(0);
portD=0x00;
enable_interrupts(int_ext);
ext_int_edge(H_TO_L);
enable_interrupts(GLOBAL);
while(1)
{
switch(mode)
{
case 1rogram1();break;
case 2rogram2();break;
}
}
}
void program1()
{
if(mode==1)
{
lcd_putc('\f');
for(i=0;i<5;i++)
{
lcd_init();
lcd_gotoxy(1,1);
lcd_putc("NGUYEN VAN THANH");
delay_ms(20);
lcd_gotoxy(1,1);
lcd_putc('\f');
delay_ms(20);
}
}
}
void program2()
{
if(mode==2)
{
lcd_putc('\f');
for(j=0;j<5;j++)
{
lcd_init();
lcd_gotoxy(1,1);
lcd_putc("HOANG THI HOAI MY");
delay_ms(20);
lcd_gotoxy(1,1);
lcd_putc('\f');
delay_ms(20);
}
}
}
I have a problem with code for LCD circuit.Please help me ! It doesn't work.
#include "C:\Program Files\PICC\Examples\hienthiso.h"
#include "C:\Program Files\PICC\Drivers\LCD.C"
#use delay(clock=20000000)
#byte portD=0x08
#byte portB=0x06
#bit RB0=0x06.0
#use fast_io(b)
#use fast_io(d)
int8 mode,i,j;
#INT_EXT
void ext_isr()
{
mode++;
delay_ms(1);
if(mode==3)
{
mode=0;
}
}
void program1();
void program2();
void main()
{
mode=0;
set_tris_b(0b00000001);
portB=0x00;
set_tris_d(0);
portD=0x00;
enable_interrupts(int_ext);
ext_int_edge(H_TO_L);
enable_interrupts(GLOBAL);
while(1)
{
switch(mode)
{
case 1rogram1();break;
case 2rogram2();break;
}
}
}
void program1()
{
if(mode==1)
{
lcd_putc('\f');
for(i=0;i<5;i++)
{
lcd_init();
lcd_gotoxy(1,1);
lcd_putc("NGUYEN VAN THANH");
delay_ms(20);
lcd_gotoxy(1,1);
lcd_putc('\f');
delay_ms(20);
}
}
}
void program2()
{
if(mode==2)
{
lcd_putc('\f');
for(j=0;j<5;j++)
{
lcd_init();
lcd_gotoxy(1,1);
lcd_putc("HOANG THI HOAI MY");
delay_ms(20);
lcd_gotoxy(1,1);
lcd_putc('\f');
delay_ms(20);
}
}
}
I have a problem with code for LCD circuit.Please help me ! It doesn't work.