for(county=0;county<=63;county++)
{
lcd_write_data(0xff);
delay(delay_time);
}
//--------------------------------------
lcd_write_command(0xbc);//set y start 0
for(county=0;county<=63;county++)
{
lcd_write_data(0xff);
delay(delay_time);
}
//--------------------------------------
lcd_write_command(0xbd);//set y start 0
for(county=0;county<=63;county++)
{
lcd_write_data(0xff);
delay(delay_time);
}
//--------------------------------------
lcd_write_command(0xbe);//set y start 0
for(county=0;county<=63;county++)
{
lcd_write_data(0xff);
delay(delay_time);
}
//--------------------------------------
lcd_write_command(0xbf);//set y start 0
for(county=0;county<=63;county++)
{
lcd_write_data(0xff);
delay(delay_time);
}
}
//===============================================================
void test3(void)
{
unsigned char row;
unsigned char col;
lcd_cs1=0;
lcd_cs2=1;
for(col=0;col<8;col++)
{
lcd_write_command(0xb8+(7-col));
for(row=0;row<64;row++)
{
lcd_write_data(chr1[col+((63-row)*8)]);
}
}
}
//===============================================================
void test4(void)
{
unsigned char row;
unsigned char col;
lcd_cs1=1;
lcd_cs2=0;
for(col=0;col<8;col++)
{
lcd_write_command(0xb8+(7-col));
for(row=0;row<64;row++)
{
lcd_write_data(chr2[col+((63-row)*8)]);
}
}
}
//===============================================================
//===============================================================
void test5(void)
{
unsigned char row;
unsigned char col;
lcd_cs1=1;
lcd_cs2=0;
for(col=0;col<8;col++)
{
lcd_write_command(0xb8+(7-col));
for(row=0;row<64;row++)
{
lcd_write_data(chr3[col+((63-row)*8)]);
}
}
}
//===============================================================
//===============================================================
void test6(void)
{
unsigned char row;
unsigned char col;
lcd_cs1=0;
lcd_cs2=1;
for(col=0;col<8;col++)
{
lcd_write_command(0xb8+(7-col));
for(row=0;row<64;row++)
{
lcd_write_data(chr4[col+((63-row)*8)]);
}
}
}
//===============================================================
void main(void)
{
unsigned char count=0;
//unsigned char temp1;
//lcd_init();
lcd_reset=0;
lcd_reset=1;
lcd_write_command(0x3f);//turn lcd
lcd_write_command(0xc0);//set x start 0
//lcd_write_command(0xba);//set y start 0
lcd_write_command(0x40);//set y start page 0
//----------------------------
//lcd_write_command(0x39);//display on
while(1)
{
test1();
delay(0x2000);
test3();
delay(0x2000);
test4();
delay(0x2000);
test2();
delay(0x2000);
test5();
delay(0x2000);
test6();
delay(0x2000);
}
}
上一页 [1] [2] [3]
本文关键字:程序 51单片机,单片机-工控设备 - 51单片机