LCD_ShowBinNum(2,4,0xAA,8); //2行4列 显示二进制数“10101010” while(1) { } } 函数void LCD_Show××Num(unsigned charLine,unsigned charColumn,unsigned intNumber,unsigned charLength),其中共有“Line”、“Column”、“Number”、“Length”四个参数。 当LCD_Show××Num()函数的第四个参数“Len...
void LCD1602_ShowChar(unsigned char xpos,unsigned char ypos,unsigned char xsz); void LCD1602_ShowStr(unsigned char xpos,unsigned char ypos,char *p); void LCD1602_ShowNum(char x, char y, unsigned int num); void LCD1602_BKLSet(unsigned char val); unsigned char LCD1602_BKLGet(); void Delay...
复制 #include<REGX52.H>#include"LCD1602.h"#include"Delay.h"voidmain(){LCD_Init();LCD_ShowChar(1,1,'A');Delay(1000);LCD_ShowString(1,3,"Hello");LCD_ShowNum(1,9,123,3);LCD_ShowSignedNum(1,13,-66,2);LCD_ShowHexNum(2,1,0xA8,2);//Ê®Áù½øÖÆLCD_ShowBinNum(...
void LCD_ShowSignedNum(unsigned char Line,unsigned char Column,int Number,unsigned char Length); void LCD_ShowHexNum(unsigned char Line,unsigned char Column,unsigned int Number,unsigned char Length); void LCD_ShowBinNum(unsigned char Line,unsigned char Column,unsigned int Number,unsigned char Lengt...
2行#defineLCD_CUR_MOVE_LEFT 0x10//光标左移#defineLCD_CUR_MOVE_RIGHT 0x14//光标右移#defineLCD_DIS_MOVE_RIGHT 0x18//显示右移#defineLCD_DIS_MOVE_LEFT 0x1c//显示左移voidDelayXms(unsignedintnum);voidLCDInit();voidLCDWriteData(unsignedchardat);voidLCDWriteCmd(unsignedcharcmd);voidLCDShowStr...
(unsignedcharx,unsignedchary);voidLCD1602_ShowChar(unsignedcharxpos,unsignedcharypos,unsignedcharxsz);voidLCD1602_ShowStr(unsignedcharxpos,unsignedcharypos,char*p);voidLCD1602_ShowNum(charx,chary,unsignedintnum);voidLCD1602_BKLSet(unsignedcharval);unsignedcharLCD1602_BKLGet();voidDelay_ms(...
voidLCD1602_ShowStr(unsignedcharxpos,unsignedcharypos,char*p); voidLCD1602_ShowNum(charx,chary,unsignedintnum); voidLCD1602_BKLSet(unsignedcharval); unsignedcharLCD1602_BKLGet(); voidDelay_ms(unsignedintnms); #endif 2、51单片机:LCD1602.c ...
* @param Length 要显示数字的长度,范围:1~16 * @retval 无 */voidLCD_ShowBinNum(unsignedcharLine,unsignedcharColumn,unsignedintNumber,unsignedcharLength){unsignedchari;LCD_SetCursor(Line,Column);for(i=Length;i>0;i--) {LCD_WriteData(Number/LCD_Pow(2,i-1)%2+'0'); } }...
void LCD1602_ShowStr(unsigned char xpos,unsigned char ypos,char *p); void LCD1602_ShowNum(char x, char y, unsigned int num); void LCD1602_BKLSet(unsigned char val); unsigned char LCD1602_BKLGet(); void Delay_ms(unsigned int nms); ...