您的位置首页生活百科

格美乐插卡双人跳舞毯插电视上显示无信号 AV和各频道都显示无信号。电视是东芝液晶的

格美乐插卡双人跳舞毯插电视上显示无信号 AV和各频道都显示无信号。电视是东芝液晶的

的有关信息介绍如下:

格美乐插卡双人跳舞毯插电视上显示无信号 AV和各频道都显示无信号。电视是东芝液晶的

STC12C5A60S2 AD转换C语言程序,转换结果在1602液晶上显示。2011-08-18 10:01QBJ2011Q | 分类:C/C++ | 浏览6168次分享到:2011-08-18 11:43 提问者采纳//1602 四线制驱动程序,根据需要自己改端口定义和延时#define LINE1 0#define LINE2 1#define LINE1_HEAD 0x80#define LINE2_HEAD 0xC0#define CLEARSCREEN LCD_en_com(0x01);LCD_delay(30)/*************************************///change this part at different boardsbit DB7=P2^7;sbit DB6=P2^6;sbit DB5=P2^5;sbit DB4=P2^4;sbit LCD1602_RS=P2^1; //data command select 1 data 0 command pin 4 sbit LCD1602_RW=P2^2; //read write select 1 read 0 write pin 5sbit LCD1602_EN=P2^3; //LCD enable signal pin 6/********************************************************************/void LCD_delay(unsigned int n) { unsigned int i=0,j=0; for (i=n;i>0;i--) for (j=0;j<12;j++); }void LCD_en_com(unsigned char command){ DB7=(command>>7)%2; DB6=(command>>6)%2; DB5=(command>>5)%2; DB4=(command>>4)%2; LCD1602_RS = 0; //RS 0 LCD1602_RW = 0; //RW 0 LCD1602_EN = 1; //EN --\|/__ Write command LCD_delay(2); LCD1602_EN = 0; DB7=(command>>3)%2; DB6=(command>>2)%2; DB5=(command>>1)%2; DB4=(command>>0)%2; LCD1602_RS = 0; //RS 0 LCD1602_RW = 0; //RW 0 LCD1602_EN = 1; //EN --\|/__ Write command LCD_delay(2); LCD1602_EN = 0;}void LCD_en_dat(unsigned char command){ DB7=(command>>7)%2; DB6=(command>>6)%2; DB5=(command>>5)%2; DB4=(command>>4)%2; LCD1602_RS = 1; //RS 1 LCD1602_RW = 0; //RW 0 LCD1602_EN = 1; //EN --\|/__ Write data LCD_delay(2); LCD1602_EN = 0; DB7=(command>>3)%2; DB6=(command>>2)%2; DB5=(command>>1)%2; DB4=(command>>0)%2; LCD1602_RS = 1; //RS 1 LCD1602_RW = 0; //RW 0 LCD1602_EN = 1; //EN --\|/__ Write data LCD_delay(2); LCD1602_EN = 0;}void LCD_set_xy(unsigned char x,unsigned char y){ unsigned char address; if(y == LINE1) address = LINE1_HEAD + x; else address = LINE2_HEAD + x; LCD_delay(10); LCD_en_com(address); }void LCD_write_string(unsigned char x,unsigned char y,unsigned char *s){ LCD_set_xy(x,y); while(*s) { LCD_en_dat(*s); s++; }}/********************************************************************/void InitTimer0(void)//200us{ TMOD = 0x01; TH0 = 0x0FE; TL0 = 0x70; EA = 1; ET0 = 1; TR0 = 1;}unsigned char LCD_ContCount=0;sbit LCDCONT=P2^0;void Timer0Interrupt(void) interrupt 1{ TH0 = 0x0FE; TL0 = 0x70;if(LCD_ContCount