根据厂家提供的LCD1602驱动代码,会直接调用即可,要知道每个函数中的参数代表什么意思。
前两位都是代表起始位,第三位代表所显示的内容,第四位代表内容长度
#include <REGX52.H>
#include "lcd1602.h"
#include "Delay.h"
int Result=0;
void main()
{
LCD_Init();
// LCD_ShowChar(1,1,'A');
// 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(2,4,0xAA,8);
while(1)
{
Result++;
Delay(1000);
LCD_ShowNum(1,1,Result,3);
}
}